File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 1515 secrets :
1616 BOT_APP_ID :
1717 description : ' The GitHub App ID for authenticating with the GitHub API'
18- required : true
18+ required : false
1919 BOT_PRIVATE_KEY :
2020 description : ' The GitHub App Private Key for authenticating with the GitHub API'
21- required : true
21+ required : false
2222
2323jobs :
2424 preview :
2525 if : github.repository_owner == 'bombshell-dev'
2626 runs-on : ubuntu-latest
2727
2828 steps :
29+ # Only generate token if secrets are provided (external calls)
2930 - name : Generate a token
31+ if : secrets.BOT_APP_ID != '' && secrets.BOT_PRIVATE_KEY != ''
3032 id : bot-token
3133 uses : actions/create-github-app-token@v1
3234 with :
3335 app-id : ${{ secrets.BOT_APP_ID }}
3436 private-key : ${{ secrets.BOT_PRIVATE_KEY }}
3537
38+ # Checkout with conditional token usage
3639 - uses : actions/checkout@v4
3740 with :
3841 ref : ${{ github.head_ref }}
39- token : ${{ steps.bot-token.outputs.token }}
42+ token : ${{ secrets.BOT_APP_ID != '' && secrets.BOT_PRIVATE_KEY != '' && steps.bot-token.outputs.token || '' }}
4043
4144 - name : Setup PNPM
4245 uses : pnpm/action-setup@v4
Original file line number Diff line number Diff line change 1111 secrets :
1212 BOT_APP_ID :
1313 description : ' The GitHub App ID for authenticating with the GitHub API'
14- required : true
14+ required : false
1515 BOT_PRIVATE_KEY :
1616 description : ' The GitHub App Private Key for authenticating with the GitHub API'
17- required : true
17+ required : false
1818
1919jobs :
2020 run :
2121 runs-on : ubuntu-latest
22-
2322 strategy :
2423 matrix :
2524 command : ${{ fromJson(inputs.commands) }}
2625
2726 steps :
27+ # Only generate token if secrets are provided (external calls)
2828 - name : Generate a token
29+ if : secrets.BOT_APP_ID != '' && secrets.BOT_PRIVATE_KEY != ''
2930 id : bot-token
3031 uses : actions/create-github-app-token@v1
3132 with :
3233 app-id : ${{ secrets.BOT_APP_ID }}
3334 private-key : ${{ secrets.BOT_PRIVATE_KEY }}
3435
36+ # Checkout with conditional token usage
3537 - uses : actions/checkout@v4
3638 with :
3739 ref : ${{ github.head_ref }}
38- token : ${{ steps.bot-token.outputs.token }}
40+ token : ${{ secrets.BOT_APP_ID != '' && secrets.BOT_PRIVATE_KEY != '' && steps.bot-token.outputs.token || '' }}
3941
4042 - name : Setup PNPM
4143 uses : pnpm/action-setup@v4
You can’t perform that action at this time.
0 commit comments