Skip to content

Commit b96b549

Browse files
Update GitHub Actions workflow for draft release
1 parent 6baef6b commit b96b549

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/publish_release.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Publish draft release
22

33
on:
44
workflow_dispatch:
5+
56
permissions:
67
contents: write
78
pull-requests: write
@@ -13,6 +14,7 @@ jobs:
1314
- name: Checkout repo
1415
uses: actions/checkout@v4
1516

17+
1618
- name: Get latest draft release
1719
id: draft
1820
run: |
@@ -29,6 +31,7 @@ jobs:
2931
fi
3032
echo "Found draft version: ${{ steps.draft.outputs.tag_name }}"
3133
34+
3235
- name: Create branch and commit VERSION
3336
run: |
3437
branch="update-version-${{ steps.draft.outputs.tag_name }}"
@@ -37,12 +40,13 @@ jobs:
3740
git add VERSION
3841
git config user.name "github-actions[bot]"
3942
git config user.email "github-actions[bot]@users.noreply.github.com"
40-
git commit -m "chore: add VERSION ${{ steps.draft.outputs.tag_name }}" || echo "No changes"
41-
git push origin "$branch"
43+
git commit -m "chore: add VERSION ${{ steps.draft.outputs.tag_name }}" || echo "No changes to commit"
44+
git push --set-upstream origin "$branch" --force
4245
43-
- name: Create PR
44-
uses: peter-evans/create-pull-request@v6
46+
47+
- name: Create pull request
4548
id: pr
49+
uses: peter-evans/create-pull-request@v6
4650
with:
4751
token: ${{ secrets.GITHUB_TOKEN }}
4852
branch: "update-version-${{ steps.draft.outputs.tag_name }}"
@@ -51,14 +55,15 @@ jobs:
5155
body: "This PR adds or updates the VERSION file for ${{ steps.draft.outputs.tag_name }}"
5256
labels: automated
5357

58+
5459
- name: Auto-merge PR
5560
uses: peter-evans/enable-pull-request-automerge@v2
5661
with:
5762
token: ${{ secrets.GITHUB_TOKEN }}
5863
pull-request-number: ${{ steps.pr.outputs.pull-request-number }}
5964
merge-method: squash
6065

61-
- name: Wait for merge
66+
- name: Wait for PR merge
6267
uses: actions/github-script@v7
6368
with:
6469
script: |

0 commit comments

Comments
 (0)