File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,14 @@ jobs:
12
12
runs-on : ubuntu-latest
13
13
permissions :
14
14
contents : write
15
- pull-requests : read
15
+ pull-requests : write
16
16
17
17
steps :
18
18
- uses : actions/checkout@v4
19
19
with :
20
20
fetch-depth : 0
21
21
ref : main
22
+ token : ${{ secrets.GITHUB_TOKEN }}
22
23
23
24
- name : Get PR title and body
24
25
id : pr-info
@@ -84,16 +85,19 @@ jobs:
84
85
git config --local user.name "github-actions[bot]"
85
86
86
87
# Create branch, commit and push
87
- git checkout -b bot/update-changelog-v${NEW_VERSION}
88
+ BRANCH_NAME="bot/update-changelog-v${NEW_VERSION}"
89
+ git checkout -b "$BRANCH_NAME"
88
90
git add CHANGELOG.md
89
91
git commit -m "docs: update changelog for v${NEW_VERSION}"
90
- git push origin bot/update-changelog-v${NEW_VERSION}
91
92
92
- # Create PR
93
+ # Force push in case branch exists
94
+ git push -f origin "$BRANCH_NAME"
95
+
96
+ # Create PR using GitHub CLI
93
97
gh pr create \
94
98
--title "docs: update changelog for v${NEW_VERSION}" \
95
99
--body "Automated changelog update for version ${NEW_VERSION}" \
96
100
--base main \
97
- --head bot/update-changelog-v${NEW_VERSION}
101
+ --head "$BRANCH_NAME" || true
98
102
env :
99
103
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments