Skip to content

Commit de01c02

Browse files
authored
Merge pull request #89 from award999/token
Allow using GITHUB_TOKEN downstream
2 parents 83abe7b + 3512e3b commit de01c02

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/swift_package_test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ on:
6060
type: boolean
6161
description: "Boolean to enable running build in windows docker container. Defaults to true"
6262
default: true
63+
needs_token:
64+
type: boolean
65+
description: "Boolean to enable providing the GITHUB_TOKEN to downstream job."
66+
default: false
6367

6468
jobs:
6569
linux-build:
@@ -80,6 +84,10 @@ jobs:
8084
run: swift --version
8185
- name: Checkout repository
8286
uses: actions/checkout@v4
87+
- name: Provide token
88+
if: ${{ inputs.needs_token }}
89+
run: |
90+
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
8391
- name: Set environment variables
8492
if: ${{ inputs.linux_env_vars }}
8593
run: |
@@ -105,6 +113,10 @@ jobs:
105113
steps:
106114
- name: Checkout repository
107115
uses: actions/checkout@v4
116+
- name: Provide token
117+
if: ${{ inputs.needs_token }}
118+
run: |
119+
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
108120
- name: Set environment variables
109121
if: ${{ inputs.windows_env_vars }}
110122
run: |

0 commit comments

Comments
 (0)