@@ -2,6 +2,7 @@ name: Publish draft release
22
33on :
44 workflow_dispatch :
5+
56permissions :
67 contents : write
78 pull-requests : write
1314 - name : Checkout repo
1415 uses : actions/checkout@v4
1516
17+
1618 - name : Get latest draft release
1719 id : draft
1820 run : |
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