Skip to content

Commit 2bbcc8e

Browse files
authored
ci: different strategy to use environment secrets
1 parent c1200be commit 2bbcc8e

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,16 @@ jobs:
3232
build-push-flavors:
3333
name: Build → Push → Test (🍨 ${{ matrix.flavor }})
3434
needs: build-push-base
35+
environment: acceptance-testing
3536
strategy:
3637
matrix:
3738
flavor: [cpp, rust]
3839
uses: ./.github/workflows/wc-build-push-test.yml
40+
secrets:
41+
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}
42+
TEST_GITHUB_USER: ${{ secrets.TEST_GITHUB_USER }}
43+
TEST_GITHUB_PASSWORD: ${{ secrets.TEST_GITHUB_PASSWORD }}
44+
TEST_GITHUB_TOTP_SECRET: ${{ secrets.TEST_GITHUB_TOTP_SECRET }}
3945
permissions:
4046
actions: read # is needed by anchore/sbom-action to find workflow artifacts when attaching release assets
4147
attestations: write # is needed by actions/attest-build-provenance to push attestations

.github/workflows/release-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
build-push-flavors:
3232
name: Build → Push → Test (🍨 ${{ matrix.flavor }})
3333
needs: build-push-base
34+
environment: acceptance-testing
3435
strategy:
3536
matrix:
3637
flavor: [cpp, rust]

.github/workflows/wc-acceptance-test.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ on:
1313
acceptance-test-path:
1414
required: true
1515
type: string
16+
secrets:
17+
TEST_GITHUB_TOKEN:
18+
required: true
19+
TEST_GITHUB_USER:
20+
required: true
21+
TEST_GITHUB_PASSWORD:
22+
required: true
23+
TEST_GITHUB_TOTP_SECRET:
24+
required: true
1625

1726
concurrency:
1827
group: ${{ github.workflow }}
@@ -25,7 +34,6 @@ jobs:
2534
test:
2635
name: Acceptance Test
2736
runs-on: ubuntu-latest
28-
environment: acceptance-testing
2937
steps:
3038
- uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
3139
with:

.github/workflows/wc-build-push-test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ on:
9393
DOCKER_REGISTRY_USERNAME:
9494
description: User name for Docker login, if not provided the GitHub actor will be used
9595
required: false
96+
TEST_GITHUB_PASSWORD:
97+
required: false
98+
TEST_GITHUB_TOKEN:
99+
required: false
100+
TEST_GITHUB_TOTP_SECRET:
101+
required: false
102+
TEST_GITHUB_USER:
103+
required: false
96104

97105
permissions: {}
98106

@@ -145,6 +153,11 @@ jobs:
145153
uses: ./.github/workflows/wc-acceptance-test.yml
146154
permissions:
147155
contents: read
156+
secrets:
157+
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}
158+
TEST_GITHUB_USER: ${{ secrets.TEST_GITHUB_USER }}
159+
TEST_GITHUB_PASSWORD: ${{ secrets.TEST_GITHUB_PASSWORD }}
160+
TEST_GITHUB_TOTP_SECRET: ${{ secrets.TEST_GITHUB_TOTP_SECRET }}
148161
with:
149162
image-basename: ${{ needs.build-push.outputs.image-basename }}
150163
devcontainer-file: ${{ inputs.test-devcontainer-file }}

0 commit comments

Comments
 (0)