Skip to content

Commit a7a3697

Browse files
committed
Fix Changelog action
1 parent b3b9039 commit a7a3697

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.github/workflows/update-changelog.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,34 @@ jobs:
1313
timeout-minutes: 5
1414

1515
steps:
16-
- name: Checkout
16+
- name: Checkout Main Branch
1717
uses: actions/checkout@v2
1818
with:
19-
ref: main # Ensure you're checking out the main branch
19+
ref: main # Start from the main branch
2020

21-
- name: Create update-changelog Branch
21+
- name: Create Unique Branch for Changelog Update
2222
run: |
23-
git checkout -b update-changelog
23+
TIMESTAMP=$(date +%s)
24+
git checkout -b update-changelog-$TIMESTAMP
2425
2526
- name: Update Changelog
2627
uses: stefanzweifel/changelog-updater-action@v1
2728
with:
28-
latest-version: ${{ github.event.release.tag_name }} # Use tag_name for correct version
29+
latest-version: ${{ github.event.release.tag_name }}
2930
release-notes: ${{ github.event.release.body }}
3031

3132
- name: Commit updated CHANGELOG
3233
uses: stefanzweifel/git-auto-commit-action@v5
3334
with:
34-
branch: update-changelog # Ensure you're on the update-changelog branch
35+
branch: update-changelog-${{ github.run_id }} # Use a unique branch name
3536
commit_message: "Update CHANGELOG"
3637
file_pattern: CHANGELOG.md
3738

3839
- name: Push changes and create PR
39-
uses: peter-evans/create-pull-request@v7
40+
uses: peter-evans/create-pull-request@v4
4041
with:
41-
branch: update-changelog
42+
branch: update-changelog-${{ github.run_id }}
43+
base: main # Target main for the PR
4244
title: "Automated Update of CHANGELOG"
4345
body: "This PR was created by GitHub Actions to update the CHANGELOG."
44-
delete-branch: true
46+
delete-branch: true # Automatically delete the branch after merging

0 commit comments

Comments
 (0)