Skip to content

Commit e13c0ba

Browse files
authored
Remove deprecated "credentials" input (#364)
1 parent 69539a8 commit e13c0ba

File tree

11 files changed

+288
-542
lines changed

11 files changed

+288
-542
lines changed

.github/workflows/integration.yml

Lines changed: 2 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'integration'
1+
name: 'Integration'
22

33
on:
44
push:
@@ -7,190 +7,15 @@ on:
77
pull_request:
88
branches:
99
- 'main'
10+
workflow_dispatch:
1011

1112
concurrency:
1213
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
1314
cancel-in-progress: true
1415

1516
jobs:
16-
auth_json:
17-
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
18-
runs-on: 'ubuntu-latest'
19-
steps:
20-
- uses: 'actions/checkout@v3'
21-
22-
- uses: 'actions/setup-node@v3'
23-
with:
24-
node-version: '16.x'
25-
26-
- name: 'npm build'
27-
run: 'npm ci && npm run build'
28-
29-
- uses: 'google-github-actions/auth@main'
30-
with:
31-
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
32-
33-
- id: 'deploy'
34-
uses: './'
35-
with:
36-
name: 'auth-json-http-${{ github.run_number }}'
37-
runtime: 'nodejs10'
38-
entry_point: 'helloWorld'
39-
source_dir: './tests/test-node-func/'
40-
41-
# Auth as the main account for integration and cleanup
42-
- uses: 'google-github-actions/auth@main'
43-
with:
44-
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
45-
46-
- name: 'integration'
47-
env:
48-
URL: '${{ steps.deploy.outputs.url }}'
49-
run: 'npm run e2e-tests'
50-
51-
- name: 'cleanup'
52-
if: ${{ always() }}
53-
env:
54-
CLEANUP_FUNCTION_NAME: '${{ steps.deploy.outputs.id }}'
55-
run: 'npm run cleanup'
56-
57-
58-
auth_workload_identity_federation:
59-
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
60-
name: 'auth_workload_identity_federation'
61-
permissions:
62-
contents: 'read'
63-
id-token: 'write'
64-
runs-on: 'ubuntu-latest'
65-
steps:
66-
- uses: 'actions/checkout@v3'
67-
68-
- uses: 'actions/setup-node@v3'
69-
with:
70-
node-version: '16.x'
71-
72-
- name: 'npm build'
73-
run: 'npm ci && npm run build'
74-
75-
- uses: 'google-github-actions/auth@main'
76-
with:
77-
workload_identity_provider: '${{ secrets.WIF_PROVIDER_NAME }}'
78-
service_account: '${{ secrets.DEPLOY_CF_SA_EMAIL }}'
79-
80-
- id: 'deploy'
81-
uses: './'
82-
with:
83-
name: 'auth-wif-http-${{ github.run_number }}'
84-
runtime: 'nodejs10'
85-
entry_point: 'helloWorld'
86-
source_dir: './tests/test-node-func/'
87-
88-
# Auth as the main account for integration and cleanup
89-
- uses: 'google-github-actions/auth@main'
90-
with:
91-
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
92-
93-
- name: 'integration'
94-
env:
95-
URL: '${{ steps.deploy.outputs.url }}'
96-
run: 'npm run e2e-tests'
97-
98-
- name: 'cleanup'
99-
if: ${{ always() }}
100-
env:
101-
CLEANUP_FUNCTION_NAME: '${{ steps.deploy.outputs.id }}'
102-
run: 'npm run cleanup'
103-
104-
# Deprecated
105-
auth_setup_gcloud:
106-
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
107-
name: 'auth_setup_gcloud'
108-
runs-on: 'ubuntu-latest'
109-
steps:
110-
- uses: 'actions/checkout@v3'
111-
112-
- uses: 'actions/setup-node@v3'
113-
with:
114-
node-version: '16.x'
115-
116-
- name: 'npm build'
117-
run: 'npm ci && npm run build'
118-
119-
- uses: 'google-github-actions/setup-gcloud@main'
120-
with:
121-
service_account_email: '${{ secrets.DEPLOY_CF_SA_EMAIL }}'
122-
service_account_key: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
123-
export_default_credentials: true
124-
125-
- id: 'deploy'
126-
uses: ./
127-
with:
128-
name: 'auth-setup-gcloud-${{ github.run_number }}'
129-
runtime: 'nodejs10'
130-
entry_point: 'helloWorld'
131-
source_dir: './tests/test-node-func/'
132-
133-
# Auth as the main account for integration and cleanup
134-
- uses: 'google-github-actions/auth@main'
135-
with:
136-
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
137-
138-
- name: 'integration'
139-
env:
140-
URL: '${{ steps.deploy.outputs.url }}'
141-
run: 'npm run e2e-tests'
142-
143-
- name: 'cleanup'
144-
if: ${{ always() }}
145-
env:
146-
CLEANUP_FUNCTION_NAME: '${{ steps.deploy.outputs.id }}'
147-
run: 'npm run cleanup'
148-
149-
# Deprecated
150-
auth_builtin_credentials:
151-
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
152-
name: 'auth_builtin_credentials'
153-
runs-on: 'ubuntu-latest'
154-
steps:
155-
- uses: 'actions/checkout@v3'
156-
157-
- uses: 'actions/setup-node@v3'
158-
with:
159-
node-version: '16.x'
160-
161-
- name: 'npm build'
162-
run: 'npm ci && npm run build'
163-
164-
- id: 'deploy'
165-
uses: './'
166-
with:
167-
credentials: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
168-
name: 'auth-builtin-${{ github.run_number }}'
169-
region: 'us-east1'
170-
runtime: 'nodejs10'
171-
entry_point: 'helloWorld'
172-
memory_mb: 512
173-
source_dir: './tests/test-node-func/'
174-
175-
# Auth as the main account for integration and cleanup
176-
- uses: 'google-github-actions/auth@main'
177-
with:
178-
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
179-
180-
- name: 'integration'
181-
env:
182-
URL: '${{ steps.deploy.outputs.url }}'
183-
run: 'npm run e2e-tests'
184-
185-
- name: 'cleanup'
186-
if: ${{ always() }}
187-
env:
188-
CLEANUP_FUNCTION_NAME: '${{ steps.deploy.outputs.id }}'
189-
run: 'npm run cleanup'
190-
19117
https_trigger:
19218
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
193-
name: 'https_trigger'
19419
permissions:
19520
contents: 'read'
19621
id-token: 'write'
@@ -219,11 +44,6 @@ jobs:
21944
source_dir: './tests/test-node-func/'
22045
https_trigger_security_level: 'secure_always'
22146

222-
# Auth as the main account for integration and cleanup
223-
- uses: 'google-github-actions/auth@main'
224-
with:
225-
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
226-
22747
- name: 'cleanup'
22848
if: ${{ always() }}
22949
env:
@@ -232,7 +52,6 @@ jobs:
23252

23353
event_trigger:
23454
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
235-
name: 'event_trigger'
23655
permissions:
23756
contents: 'read'
23857
id-token: 'write'
@@ -273,11 +92,6 @@ jobs:
27392
max_instances: 5
27493
timeout: 300
27594

276-
# Auth as the main account for integration and cleanup
277-
- uses: 'google-github-actions/auth@main'
278-
with:
279-
credentials_json: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
280-
28195
- name: 'cleanup'
28296
if: ${{ always() }}
28397
env:

.github/workflows/label.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/unit.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'unit'
1+
name: 'Unit'
22

33
on:
44
push:
@@ -15,15 +15,18 @@ concurrency:
1515

1616
jobs:
1717
unit:
18-
name: 'unit'
19-
runs-on: '${{ matrix.os }}'
18+
permissions:
19+
contents: 'read'
20+
id-token: 'write'
21+
2022
strategy:
2123
fail-fast: false
2224
matrix:
2325
os:
2426
- 'ubuntu-latest'
2527
- 'windows-latest'
2628
- 'macos-latest'
29+
runs-on: '${{ matrix.os }}'
2730

2831
steps:
2932
- uses: 'actions/checkout@v3'
@@ -41,10 +44,15 @@ jobs:
4144
if: ${{ matrix.os == 'ubuntu-latest' }}
4245
run: 'npm run lint'
4346

47+
- uses: 'google-github-actions/auth@main'
48+
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
49+
with:
50+
workload_identity_provider: '${{ secrets.WIF_PROVIDER_NAME }}'
51+
service_account: '${{ secrets.DEPLOY_CF_SA_EMAIL }}'
52+
4453
- name: 'npm test'
4554
env:
4655
DEPLOY_CF_PROJECT_ID: '${{ secrets.DEPLOY_CF_PROJECT_ID }}'
4756
DEPLOY_CF_SA_EMAIL: '${{ secrets.DEPLOY_CF_SA_EMAIL }}'
48-
DEPLOY_CF_SA_KEY_JSON: '${{ secrets.DEPLOY_CF_SA_KEY_JSON }}'
4957
DEPLOY_CF_SECRET_VERSION_REF: '${{ secrets.DEPLOY_CF_SECRET_VERSION_REF }}'
5058
run: 'npm run test'

0 commit comments

Comments
 (0)