Skip to content

Commit 018c07f

Browse files
committed
Refactor CI workflow to use GITHUB_TOKEN env var
Replaces direct usage of needs.generate-token.outputs.token with the GITHUB_TOKEN environment variable across all jobs. Simplifies environment variable management and updates Git configuration and build steps accordingly.
1 parent 32504df commit 018c07f

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
needs: generate-token
3030
permissions:
3131
contents: read
32+
env:
33+
GITHUB_TOKEN: ${{ needs.generate-token.outputs.token }}
3234
steps:
3335
- name: Checkout code
3436
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -51,7 +53,7 @@ jobs:
5153

5254
- name: Configure Git for private repos
5355
run: |
54-
git config --global url."https://x-access-token:${{ needs.generate-token.outputs.token }}@github.com/descope".insteadOf "https://github.com/descope"
56+
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/descope".insteadOf "https://github.com/descope"
5557
5658
- name: Download and vendor dependencies
5759
run: |
@@ -61,15 +63,16 @@ jobs:
6163
- name: Build using vendor approach
6264
run: |
6365
make build
64-
env:
65-
CI_READ_COMMON: ${{ needs.generate-token.outputs.token }}
66+
6667
6768
lint:
6869
name: Lint and more checks
6970
runs-on: ubuntu-latest
7071
needs: generate-token
7172
permissions:
7273
contents: read
74+
env:
75+
GITHUB_TOKEN: ${{ needs.generate-token.outputs.token }}
7376
steps:
7477
- name: Checkout code
7578
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -92,7 +95,7 @@ jobs:
9295

9396
- name: Configure Git for private repos
9497
run: |
95-
git config --global url."https://x-access-token:${{ needs.generate-token.outputs.token }}@github.com/descope".insteadOf "https://github.com/descope"
98+
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/descope".insteadOf "https://github.com/descope"
9699
97100
- name: Download and vendor dependencies
98101
run: |
@@ -110,6 +113,8 @@ jobs:
110113
needs: generate-token
111114
permissions:
112115
contents: read
116+
env:
117+
GITHUB_TOKEN: ${{ needs.generate-token.outputs.token }}
113118
steps:
114119
- name: Checkout code
115120
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -132,7 +137,7 @@ jobs:
132137

133138
- name: Configure Git for private repos
134139
run: |
135-
git config --global url."https://x-access-token:${{ needs.generate-token.outputs.token }}@github.com/descope".insteadOf "https://github.com/descope"
140+
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/descope".insteadOf "https://github.com/descope"
136141
137142
- name: Download and vendor dependencies
138143
run: |
@@ -152,6 +157,8 @@ jobs:
152157
needs: generate-token
153158
permissions:
154159
contents: read
160+
env:
161+
GITHUB_TOKEN: ${{ needs.generate-token.outputs.token }}
155162
steps:
156163
- name: Checkout code
157164
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -174,7 +181,7 @@ jobs:
174181

175182
- name: Configure Git for private repos
176183
run: |
177-
git config --global url."https://x-access-token:${{ needs.generate-token.outputs.token }}@github.com/descope".insteadOf "https://github.com/descope"
184+
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/descope".insteadOf "https://github.com/descope"
178185
179186
- name: Download and vendor dependencies
180187
run: |
@@ -195,6 +202,8 @@ jobs:
195202
contents: read
196203
id-token: write
197204
attestations: write
205+
env:
206+
GITHUB_TOKEN: ${{ needs.generate-token.outputs.token }}
198207
steps:
199208
- name: Checkout code
200209
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -211,5 +220,4 @@ jobs:
211220
- name: Pack and Upload using vendor approach
212221
run: |
213222
make build
214-
env:
215-
CI_READ_COMMON: ${{ needs.generate-token.outputs.token }}
223+

0 commit comments

Comments
 (0)