diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml new file mode 100644 index 00000000..786b1326 --- /dev/null +++ b/.github/workflows/changelog.yaml @@ -0,0 +1,36 @@ +name: Build & Test & Push Image +on: + push: + branches: + - "main" + - "develop" + tags: + - "v*" +jobs: + changelog: + name: Generate changelog + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Generate changelog + uses: orhun/git-cliff-action@v4 + with: + config: cliff.toml + args: --verbose + env: + OUTPUT: CHANGELOG.md + GITHUB_REPO: ${{ github.repository }} + - name: Commit + run: | + git checkout ${GITHUB_REF_NAME} + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + set +e + git add CHANGELOG.md + git commit -m "chore(changelog): Update changelog [skip ci]" + git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git ${GITHUB_REF_NAME} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 15771c94..6febee35 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -107,30 +107,3 @@ jobs: labels: ${{ steps.meta-hasura.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - changelog: - name: Generate changelog - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Generate changelog - uses: orhun/git-cliff-action@v4 - with: - config: cliff.toml - args: --verbose - env: - OUTPUT: CHANGELOG.md - GITHUB_REPO: ${{ github.repository }} - - name: Commit - run: | - git checkout ${GITHUB_REF_NAME} - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - set +e - git add CHANGELOG.md - git commit -m "chore(changelog): Update changelog [skip ci]" - git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git ${GITHUB_REF_NAME}