From 21319b15eb02e0262172afd4ce8a19d142793e04 Mon Sep 17 00:00:00 2001 From: Aviral Singh Date: Wed, 2 Aug 2023 00:29:11 +0530 Subject: [PATCH] feat: Generating changelog.md using github actions! (#2837) * feat: Generating changelog.md using github actions! This PR will close down the issue #2797 which will generate a chnagelog.md in the root repository of Porter when a release is published! fixes: #2797 Signed-off-by: Aviral Singh --- .github/workflows/changelog.yaml | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/changelog.yaml diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml new file mode 100644 index 000000000..6b6023c67 --- /dev/null +++ b/.github/workflows/changelog.yaml @@ -0,0 +1,34 @@ +name: Generate Changelog for Porter +on: + release: + types: [published] + +jobs: + changelog: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3.3.0 + with: + ref: main + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + + - name: Install conventional-changelog-cli + run: npm install -g conventional-changelog-cli + + - name: Generate changelog + run: conventional-changelog -p angular -i CHANGELOG.md -s -r 0 + + - name: Commit and push changes + run: | + git config --global user.name 'GitHub Actions' + git config --global user.email 'actions@github.com' + git add CHANGELOG.md + git commit -m "Updated Changelog after Latest Release" || echo "No changes to commit" + git push origin main