Skip to content

Commit 1daa227

Browse files
authored
Update GitHub Actions to use GitHub App token
1 parent 7e001dd commit 1daa227

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/test-helmfile-raw-default-kube-version.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434

3535
test:
3636
runs-on: ubuntu-latest
37+
environment: terratest
3738
continue-on-error: true
3839
needs: [setup]
3940
services:
@@ -70,6 +71,13 @@ jobs:
7071
## Use localhost to connect localstack because the commands runs not in a container
7172
AWS_ENDPOINT_OVERRIDE: http://localhost:4566
7273
74+
- uses: actions/create-github-app-token@v2
75+
id: github-app
76+
with:
77+
app-id: ${{ vars.BOT_GITHUB_APP_ID }}
78+
private-key: ${{ secrets.BOT_GITHUB_APP_PRIVATE_KEY }}
79+
owner: 'cloudposse-tests'
80+
7381
- uses: ./action
7482
id: current
7583
with:
@@ -80,7 +88,7 @@ jobs:
8088
path: ./action/test/helmfile/helmfile.yaml
8189
application: test-app
8290
ssm-path: platform/default
83-
github-pat: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
91+
github-pat: ${{ steps.github-app.outputs.token }}
8492
image: nginx
8593
image-tag: ${{ needs.setup.outputs.random }}
8694
repository: ${{ github.repository }}
@@ -101,6 +109,7 @@ jobs:
101109

102110
assert:
103111
runs-on: ubuntu-latest
112+
environment: terratest
104113
needs: [setup, test]
105114
steps:
106115
- uses: nick-fields/assert-action@v1
@@ -119,12 +128,19 @@ jobs:
119128
actual: "${{ needs.test.outputs.sha }}"
120129
comparison: notEqual
121130

131+
- uses: actions/create-github-app-token@v2
132+
id: github-app
133+
with:
134+
app-id: ${{ vars.BOT_GITHUB_APP_ID }}
135+
private-key: ${{ secrets.BOT_GITHUB_APP_PRIVATE_KEY }}
136+
owner: 'cloudposse-tests'
137+
122138
- name: Checkout Argo Configuration
123139
uses: actions/checkout@v3
124140
with:
125141
repository: cloudposse-tests/argocd-deploy-non-prod-test
126142
ref: ${{ needs.test.outputs.sha }}
127-
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
143+
token: ${{ steps.github-app.outputs.token }}
128144
path: ./assert
129145

130146
- name: Get Image

0 commit comments

Comments
 (0)