Skip to content

Commit 1cc2d01

Browse files
Fix workflow token: use ternary to handle absent GH_PAT secret
secrets.GH_PAT || github.token evaluates the empty string as truthy in GitHub Actions expressions, causing 'Input required and not supplied: token'. Use the correct ternary: secrets.GH_PAT != '' && secrets.GH_PAT || github.token so GITHUB_TOKEN is used automatically when no PAT is configured.
1 parent 11d4ed4 commit 1cc2d01

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
1818
with:
19-
token: ${{ secrets.GH_PAT || github.token }}
19+
token: ${{ secrets.GH_PAT != '' && secrets.GH_PAT || github.token }}
2020
persist-credentials: false
2121

2222
- name: Set up Node

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
1818
with:
19-
token: ${{ secrets.GH_PAT || github.token }}
19+
token: ${{ secrets.GH_PAT != '' && secrets.GH_PAT || github.token }}
2020
persist-credentials: false
2121

2222
- name: Set up Node

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
1818
with:
19-
token: ${{ secrets.GH_PAT || github.token }}
19+
token: ${{ secrets.GH_PAT != '' && secrets.GH_PAT || github.token }}
2020
persist-credentials: false
2121

2222
- name: Set up Node

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
2121
with:
22-
token: ${{ secrets.GH_PAT || github.token }}
22+
token: ${{ secrets.GH_PAT != '' && secrets.GH_PAT || github.token }}
2323
persist-credentials: false
2424

2525
- name: Set up Node

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
1717
with:
18-
token: ${{ secrets.GH_PAT || github.token }}
18+
token: ${{ secrets.GH_PAT != '' && secrets.GH_PAT || github.token }}
1919
persist-credentials: false
2020

2121
- name: Set up Node

.github/workflows/sf-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
2727
with:
28-
token: ${{ secrets.GH_PAT || github.token }}
28+
token: ${{ secrets.GH_PAT != '' && secrets.GH_PAT || github.token }}
2929
persist-credentials: false
3030
ref: ${{ github.event.inputs.sha }}
3131

0 commit comments

Comments
 (0)