Skip to content

Commit

Permalink
changelog automation (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
henrykie authored Sep 12, 2024
1 parent 9971175 commit df6469b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILE_TO_COMMIT: CHANGELOG.md
DESTINATION_BRANCH: changelog-update-${{ github.run_id }}
DESTINATION_BRANCH: changelog-${{ github.run_id }}
run: |
export TODAY=$( date -u '+%Y-%m-%d' )
export MESSAGE="chore: regenerate $FILE_TO_COMMIT for $TODAY"
export SHA=$( git rev-parse $DESTINATION_BRANCH:$FILE_TO_COMMIT )
export CONTENT=$( base64 -i $FILE_TO_COMMIT )
gh api --method POST /repos/:owner/:repo/git/refs \
--field ref="refs/head/changelog-update-${{ github.run_id }}" \
--field ref="refs/head/changelog-${{ github.run_id }}" \
--field sha="$SHA"
gh api --method PUT /repos/:owner/:repo/contents/$FILE_TO_COMMIT \
--field message="$MESSAGE" \
--field content="$CONTENT" \
--field encoding="base64" \
--field branch="$DESTINATION_BRANCH" \
--field sha="$SHA"
gh pr create --title "chore: update changelog" --body "This is an auto-generated PR to update the changelog." --base main --head changelog-update-${{ github.run_id }}
gh pr create --title "chore: update changelog" --body "This is an auto-generated PR to update the changelog." --base main --head changelog-${{ github.run_id }}

0 comments on commit df6469b

Please sign in to comment.