44 workflow_call :
55 secrets :
66 BOT_TOKEN :
7- required : true
7+ required : false
88 release :
99 types : [prereleased]
1010
3131 #
3232 uses : actions/checkout@v4
3333 with :
34- token : ${{ secrets.BOT_TOKEN }}
34+ token : ${{ secrets.BOT_TOKEN || github.token }}
3535 ref : ${{ github.event.release.target_commitish }}
3636
3737 - name : Update Changelog
9696 - name : Push to protected branch
9797 uses : CasperWA/push-protected@v2
9898 with :
99- token : ${{ secrets.BOT_TOKEN }}
99+ token : ${{ secrets.BOT_TOKEN || github.token }}
100100 # branch: ${{ github.event.release.target_commitish }}
101101 branch : main
102102 # unprotect_reviews: true # has anoying side-effect: settings stays disabled if workflow fails
@@ -112,7 +112,7 @@ jobs:
112112 - name : Checkout code
113113 uses : actions/checkout@v4
114114 with :
115- token : ${{ secrets.BOT_TOKEN }}
115+ token : ${{ secrets.BOT_TOKEN || github.token }}
116116 ref : ' main'
117117
118118 - name : Get latest commit ID
@@ -124,13 +124,13 @@ jobs:
124124 - uses : jimeh/update-tags-action@v1
125125 with :
126126 tags : ${{ github.event.release.tag_name }},latest
127- github_token : ${{ secrets.BOT_TOKEN }}
127+ github_token : ${{ secrets.BOT_TOKEN || github.token }}
128128 ref : ${{ env.LATEST_COMMIT_ID }}
129129
130130 - name : publish pre-Release as Release
131131 uses : actions/github-script@v7
132132 with :
133- github-token : ${{ secrets.BOT_TOKEN }}
133+ github-token : ${{ secrets.BOT_TOKEN || github.token }}
134134 script : |
135135 const { owner, repo } = context.repo;
136136 const release = await github.rest.repos.getReleaseByTag({
0 commit comments