Skip to content

Commit

Permalink
chore(ci): more fixes for the rebuild changelog action (#933)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev authored Feb 3, 2025
1 parent 7f8af8f commit f8d4ba9
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/rebuild-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
name: Rebuild changelog
runs-on: ubuntu-latest
steps:
- uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
id: app-token
with:
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
# don't checkout a detached HEAD, is important to have a real base
Expand All @@ -30,13 +36,11 @@ jobs:
# this is important so git log can pick up on
# the whole history to generate the CHANGELOG
fetch-depth: '0'
token: ${{ steps.app-token.outputs.token }}

- name: Update CHANGELOG.md
# List all the releases and rebuild
# the changelog with the last 30
# releases
# Use the `--limit` parameter in `gh release list`
# to tweak this number
# the changelog.
run: |
echo "# Change Log" > CHANGELOG.md
echo "" >> CHANGELOG.md
Expand Down Expand Up @@ -64,7 +68,7 @@ jobs:
echo "" >> CHANGELOG.md
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Create Pull Request
id: cpr
Expand All @@ -78,11 +82,12 @@ jobs:
CHANGELOG.md
body: |
- Update `CHANGELOG.md`
token: ${{ steps.app-token.outputs.token }}
author: "${{ steps.app-token.outputs.app-slug}}[bot] <${{ steps.app-token.outputs.app-email }}>"
committer: "${{ steps.app-token.outputs.app-slug}}[bot] <${{ steps.app-token.outputs.app-email }}>"

- name: Merge PR
env:
PULL_REQUEST_NUMBER: ${{steps.cpr.outputs.pull-request-number}}
# NOTE: we don't use a PAT so to not trigger further automation
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
gh pr merge $PULL_REQUEST_NUMBER --squash --delete-branch
gh pr merge ${{steps.cpr.outputs.pull-request-number}} --squash --delete-branch --auto

0 comments on commit f8d4ba9

Please sign in to comment.