File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 66 types : [published] # Trigger on new release
77 workflow_dispatch : # Manual trigger
88
9+ permissions :
10+ contents : write
11+
912jobs :
1013 update-releases-md :
1114 runs-on : ubuntu-latest
1215
1316 steps :
1417 - name : Checkout repo
1518 uses : actions/checkout@v4
19+ with :
20+ fetch-depth : 0
1621
1722 - name : Set up Node.js
1823 uses : actions/setup-node@v4
2631 run : npm run releases
2732
2833 - name : Commit and push .github/RELEASES.md
34+ env :
35+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2936 run : |
3037 git config user.name "github-actions[bot]"
3138 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
39+
40+ # Switch to the default branch
41+ git fetch origin
42+ DEFAULT_BRANCH=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
43+ git checkout $DEFAULT_BRANCH
44+ git pull origin $DEFAULT_BRANCH
45+
3246 git add .github/RELEASES.md
3347 git commit -m "docs: update RELEASES.md on new release" || echo "No changes"
34- git push
48+
49+ git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
50+ git push origin $DEFAULT_BRANCH
You can’t perform that action at this time.
0 commit comments