Skip to content

Commit 5726f23

Browse files
committed
simplify az-sync action
1 parent 449daf4 commit 5726f23

File tree

7 files changed

+12
-99
lines changed

7 files changed

+12
-99
lines changed

.github/actions/az-sync/action.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@ name: Sync Secrets from Azure Key Vault
22
author: s.breen
33
description: az-sync
44
inputs:
5-
az_client_id:
6-
description: 'Azure Client ID'
7-
required: true
8-
az_tenant_id:
9-
description: 'Azure Tenant ID'
10-
required: true
11-
az_subscription_id:
12-
description: 'Azure Subscription ID'
13-
required: true
145
keyvault:
156
description: 'Azure Key Vault name'
167
required: true
@@ -24,9 +15,9 @@ runs:
2415
- name: Azure login
2516
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
2617
with:
27-
client-id: ${{ inputs.az_client_id }}
28-
tenant-id: ${{ inputs.az_tenant_id }}
29-
subscription-id: ${{ inputs.az_subscription_id }}
18+
client-id: ${{ env.AZ_KEYVAULT_CLIENT_ID }}
19+
tenant-id: ${{ env.AZ_KEYVAULT_TENANT_ID }}
20+
subscription-id: ${{ env.AZ_SUBSCRIPTION_ID }}
3021

3122
- name: Sync
3223
shell: bash

.github/workflows/assertion.yml

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,6 @@ on:
1616
type: boolean
1717
required: false
1818
default: false
19-
workflow_call:
20-
inputs:
21-
packageVersion:
22-
description: 'Agent version'
23-
type: string
24-
required: true
25-
runId:
26-
description: 'Run ID of the workflow that built the artifacts'
27-
type: string
28-
required: false
29-
signAssertion:
30-
description: 'Sign and store the assertion document'
31-
type: boolean
32-
required: false
33-
default: false
34-
secrets:
35-
ARTIFACTORY_USER:
36-
required: true
37-
ARTIFACTORY_TOKEN:
38-
required: true
39-
ARTIFACTORY_URL:
40-
required: true
4119

4220
jobs:
4321
build-assertion-document:
@@ -94,9 +72,9 @@ jobs:
9472
builder-id: 'github.com'
9573
builder-version: '${{env.GO_VERSION}}_test'
9674
invocation-id: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
97-
artifactory-user: ${{ secrets.ARTIFACTORY_USER }}
98-
artifactory-api-token: ${{ secrets.ARTIFACTORY_TOKEN }}
99-
artifactory-url: ${{ secrets.ARTIFACTORY_URL }}
75+
artifactory-user: ${{ env.artifactory-user }}
76+
artifactory-api-token: ${{ env.artifactory-token }}
77+
artifactory-url: ${{ env.artifactory-url }}
10078
artifactory-repo: 'f5-nginx-go-local-approved-dependency'
10179
assertion-doc-file: assertion_nginx-agent_${{ inputs.packageVersion }}_${{ matrix.osarch }}.json
10280
build-content-path: ${{ env.goversionm }}

.github/workflows/ci.yml

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ jobs:
3535
- name: Get Secrets from Azure Key Vault
3636
uses: ./.github/actions/az-sync
3737
with:
38-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
39-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
40-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
4138
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
4239
secrets-filter: 'artifactory'
4340
- name: Configure Go Proxy
@@ -71,9 +68,6 @@ jobs:
7168
- name: Get Secrets from Azure Key Vault
7269
uses: ./.github/actions/az-sync
7370
with:
74-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
75-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
76-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
7771
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
7872
secrets-filter: 'artifactory'
7973
- name: Configure Go Proxy
@@ -112,9 +106,6 @@ jobs:
112106
- name: Get Secrets from Azure Key Vault
113107
uses: ./.github/actions/az-sync
114108
with:
115-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
116-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
117-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
118109
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
119110
secrets-filter: 'artifactory'
120111
- name: Configure Go Proxy
@@ -147,9 +138,6 @@ jobs:
147138
- name: Get Secrets from Azure Key Vault
148139
uses: ./.github/actions/az-sync
149140
with:
150-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
151-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
152-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
153141
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
154142
secrets-filter: 'artifactory'
155143
- name: Configure Go Proxy
@@ -179,9 +167,6 @@ jobs:
179167
- name: Get Secrets from Azure Key Vault
180168
uses: ./.github/actions/az-sync
181169
with:
182-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
183-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
184-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
185170
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
186171
secrets-filter: 'artifactory'
187172
- name: Configure Go Proxy
@@ -232,9 +217,6 @@ jobs:
232217
- name: Get Secrets from Azure Key Vault
233218
uses: ./.github/actions/az-sync
234219
with:
235-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
236-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
237-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
238220
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
239221
secrets-filter: 'artifactory'
240222
- name: Configure Go Proxy
@@ -294,9 +276,6 @@ jobs:
294276
- name: Get Secrets from Azure Key Vault
295277
uses: ./.github/actions/az-sync
296278
with:
297-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
298-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
299-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
300279
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
301280
secrets-filter: 'artifactory'
302281
- name: Configure Go Proxy
@@ -363,9 +342,6 @@ jobs:
363342
- name: Get Secrets from Azure Key Vault
364343
uses: ./.github/actions/az-sync
365344
with:
366-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
367-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
368-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
369345
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
370346
secrets-filter: 'artifactory'
371347
- name: Configure Go Proxy
@@ -442,9 +418,6 @@ jobs:
442418
- name: Get Secrets from Azure Key Vault
443419
uses: ./.github/actions/az-sync
444420
with:
445-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
446-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
447-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
448421
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
449422
secrets-filter: 'artifactory'
450423
- name: Configure Go Proxy
@@ -520,9 +493,6 @@ jobs:
520493
- name: Get Secrets from Azure Key Vault
521494
uses: ./.github/actions/az-sync
522495
with:
523-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
524-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
525-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
526496
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
527497
secrets-filter: 'artifactory'
528498
- name: Configure Go Proxy
@@ -599,9 +569,6 @@ jobs:
599569
- name: Get Secrets from Azure Key Vault
600570
uses: ./.github/actions/az-sync
601571
with:
602-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
603-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
604-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
605572
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
606573
secrets-filter: 'artifactory'
607574
- name: Configure Go Proxy
@@ -662,9 +629,6 @@ jobs:
662629
- name: Get Secrets from Azure Key Vault
663630
uses: ./.github/actions/az-sync
664631
with:
665-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
666-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
667-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
668632
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
669633
secrets-filter: 'artifactory'
670634
- name: Configure Go Proxy
@@ -735,9 +699,6 @@ jobs:
735699
- name: Get Secrets from Azure Key Vault
736700
uses: ./.github/actions/az-sync
737701
with:
738-
az_client_id: ${{ secrets.AZ_KEYVAULT_CLIENT_ID }}
739-
az_tenant_id: ${{ secrets.AZ_KEYVAULT_TENANT_ID }}
740-
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
741702
keyvault: ${{ secrets.AZ_KEYVAULT_AGENT }}
742703
secrets-filter: 'nginx-crt,nginx-key'
743704

@@ -787,4 +748,4 @@ jobs:
787748

788749
- name: Push load test result
789750
if: ${{ success() && github.ref_name == 'main' }}
790-
run: git push 'https://github-actions:${{ secrets.GITHUB_TOKEN }}@github.com/nginx/agent.git' benchmark-results:benchmark-results
751+
run: git push 'https://github-actions:${{ github.token }}@github.com/nginx/agent.git' benchmark-results:benchmark-results

.github/workflows/f5-cla.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ jobs:
4747
# Do not lock PRs after a merge.
4848
lock-pullrequest-aftermerge: false
4949
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
GITHUB_TOKEN: ${{ github.token }}
5151
PERSONAL_ACCESS_TOKEN: ${{ secrets.F5_CLA_TOKEN }}

.github/workflows/label-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
with:
1919
disable-releaser: true
2020
env:
21-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/release-branch.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -291,23 +291,6 @@ jobs:
291291
run: |
292292
make release
293293
294-
assertion-document:
295-
name: Build and Generate Assertion Document
296-
needs: [build-and-upload-packages]
297-
if : ${{ inputs.assertionDoc == true }}
298-
uses: ./.github/workflows/assertion.yml
299-
permissions:
300-
id-token: write
301-
contents: read
302-
with:
303-
packageVersion: ${{ inputs.packageVersion }}
304-
runId: ${{ github.run_id }}
305-
secrets:
306-
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
307-
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
308-
ARTIFACTORY_URL: ${{ secrets.ARTIFACTORY_URL }}
309-
310-
311294
merge-release:
312295
if: ${{ needs.vars.outputs.create_pull_request == 'true' }}
313296
name: Merge release branch back into main branch

.github/workflows/vulncheck.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ on:
55
target-branch:
66
description: 'Target branch to run govulncheck against'
77
type: string
8-
required: false
8+
required: true
99
default: 'main'
1010
workflow_dispatch:
1111
inputs:
1212
target-branch:
1313
description: 'Target branch to run govulncheck against'
14-
required: false
14+
required: true
1515
default: 'main'
1616

1717
jobs:
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
2626
with:
2727
fetch-depth: 0
28-
ref: ${{ inputs.targetBranch || 'main' }}
28+
ref: ${{ inputs.targetBranch || github.event.inputs.target-branch }}
2929

3030
- name: Check Go version
3131
id: get-go-version

0 commit comments

Comments
 (0)