From 431c7bc3b2b50c682b3ff31ecfafd6b3781956cb Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Wed, 10 Dec 2025 10:03:10 -0600 Subject: [PATCH] chore(ci): generate changelog on pushes to main (#3951) Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com> --- .github/workflows/main-push-changelog.yml | 55 +++++++++++++++++++++++ .github/workflows/pull-request.yml | 8 ---- 2 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/main-push-changelog.yml diff --git a/.github/workflows/main-push-changelog.yml b/.github/workflows/main-push-changelog.yml new file mode 100644 index 000000000..25de53475 --- /dev/null +++ b/.github/workflows/main-push-changelog.yml @@ -0,0 +1,55 @@ +name: Main Push Changelog + +on: + push: + branches: + - main + +concurrency: + group: main-push-${{ github.ref }} + cancel-in-progress: true + +jobs: + main-push-changelog: + name: Generate main push changelog + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Determine last production tag + id: last_prod_tag + run: | + # Find the most recent tag that looks like a production release (vX.Y.Z) + TAG=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-creatordate | head -n 1) + echo "Found last production tag: $TAG" + echo "tag=$TAG" >> "$GITHUB_OUTPUT" + + - name: Generate changelog from last production tag to current + if: steps.last_prod_tag.outputs.tag != '' + uses: mikepenz/release-changelog-builder-action@v5 + id: changelog + with: + configuration: .github/release.yml + fromTag: ${{ steps.last_prod_tag.outputs.tag }} + toTag: ${{ github.sha }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Print main push summary + run: | + echo "Pushed to main" + echo "SHA: $GITHUB_SHA" + echo "Actor: $GITHUB_ACTOR" + echo "Ref: $GITHUB_REF" + echo "" + if [ "${{ steps.last_prod_tag.outputs.tag }}" != "" ]; then + echo "Changelog since last production tag (${{ steps.last_prod_tag.outputs.tag }})": + echo "----------------------------------------" + echo "${{ steps.changelog.outputs.changelog }}" + else + echo "No production tag (vX.Y.Z) found. Skipping changelog generation." + fi + diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index c61631975..3fe68a807 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,14 +1,6 @@ name: Android CI (PR) on: - push: - branches: - - main - paths-ignore: - - "**.md" - - ".idea/**" - - ".gitignore" - - ".gitmodules" pull_request: branches: - main