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 15
15
secrets :
16
16
BOT_APP_ID :
17
17
description : ' The GitHub App ID for authenticating with the GitHub API'
18
- required : true
18
+ required : false
19
19
BOT_PRIVATE_KEY :
20
20
description : ' The GitHub App Private Key for authenticating with the GitHub API'
21
- required : true
21
+ required : false
22
22
23
23
jobs :
24
24
preview :
25
25
if : github.repository_owner == 'bombshell-dev'
26
26
runs-on : ubuntu-latest
27
27
28
28
steps :
29
+ # Only generate token if secrets are provided (external calls)
29
30
- name : Generate a token
31
+ if : secrets.BOT_APP_ID != '' && secrets.BOT_PRIVATE_KEY != ''
30
32
id : bot-token
31
33
uses : actions/create-github-app-token@v1
32
34
with :
33
35
app-id : ${{ secrets.BOT_APP_ID }}
34
36
private-key : ${{ secrets.BOT_PRIVATE_KEY }}
35
37
38
+ # Checkout with conditional token usage
36
39
- uses : actions/checkout@v4
37
40
with :
38
41
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 || '' }}
40
43
41
44
- name : Setup PNPM
42
45
uses : pnpm/action-setup@v4
Original file line number Diff line number Diff line change 11
11
secrets :
12
12
BOT_APP_ID :
13
13
description : ' The GitHub App ID for authenticating with the GitHub API'
14
- required : true
14
+ required : false
15
15
BOT_PRIVATE_KEY :
16
16
description : ' The GitHub App Private Key for authenticating with the GitHub API'
17
- required : true
17
+ required : false
18
18
19
19
jobs :
20
20
run :
21
21
runs-on : ubuntu-latest
22
-
23
22
strategy :
24
23
matrix :
25
24
command : ${{ fromJson(inputs.commands) }}
26
25
27
26
steps :
27
+ # Only generate token if secrets are provided (external calls)
28
28
- name : Generate a token
29
+ if : secrets.BOT_APP_ID != '' && secrets.BOT_PRIVATE_KEY != ''
29
30
id : bot-token
30
31
uses : actions/create-github-app-token@v1
31
32
with :
32
33
app-id : ${{ secrets.BOT_APP_ID }}
33
34
private-key : ${{ secrets.BOT_PRIVATE_KEY }}
34
35
36
+ # Checkout with conditional token usage
35
37
- uses : actions/checkout@v4
36
38
with :
37
39
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 || '' }}
39
41
40
42
- name : Setup PNPM
41
43
uses : pnpm/action-setup@v4
You can’t perform that action at this time.
0 commit comments