Skip to content

Commit 57b91b3

Browse files
ci: remove passing of secrets (#9)
Signed-off-by: Patrick Stephens <pat@fluent.do>
1 parent 4266ee2 commit 57b91b3

2 files changed

Lines changed: 23 additions & 35 deletions

File tree

.github/workflows/add-mapping-version.yaml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,9 @@ on:
1616
type: boolean
1717
default: false
1818
jobs:
19-
get-github-token:
20-
name: Get GitHub Token
21-
runs-on: ubuntu-latest
22-
permissions:
23-
contents: read
24-
id-token: write
25-
outputs:
26-
github-token: ${{ steps.get-secrets.outputs.github-pat }}
27-
steps:
28-
- name: Authenticate with GCP
29-
uses: google-github-actions/auth@v2
30-
with:
31-
workload_identity_provider: "projects/841522437311/locations/global/workloadIdentityPools/github-actions/providers/github-actions"
32-
service_account: "terraform-infra@infrastructure-464010.iam.gserviceaccount.com"
33-
create_credentials_file: true
34-
export_environment_variables: true
35-
36-
- id: get-secrets
37-
name: Get secrets from GCP Secret Manager
38-
# This step retrieves secrets from GCP Secret Manager and sets them as outputs
39-
# The secrets can then be accessed in subsequent steps using ${{ steps.get-secrets.outputs.<secret_name> }}
40-
uses: "google-github-actions/get-secretmanager-secrets@v2"
41-
with:
42-
secrets: |-
43-
github-pat:projects/626836145334/secrets/GITHUB_CI_PAT
44-
4519
add-mapping-version:
46-
needs: get-github-token
4720
uses: ./.github/workflows/call-add-mapping-version.yaml
4821
with:
4922
agent-version: ${{ github.event.inputs.agent-version }}
5023
oss-version: ${{ github.event.inputs.oss-version }}
5124
dry-run: ${{ github.event.inputs.dry-run }}
52-
secrets:
53-
github-token: ${{ needs.get-github-token.outputs.github-token }}

.github/workflows/call-add-mapping-version.yaml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,35 @@ on:
1515
required: false
1616
type: boolean
1717
default: false
18-
secrets:
19-
github-token:
20-
description: 'GitHub token for authentication'
2118
jobs:
2219
add-mapping-version:
20+
name: Add Mapping Version ${{ inputs.agent-version }} --> ${{ inputs.oss-version }}
21+
permissions:
22+
contents: read
23+
pull-requests: write
24+
id-token: write
2325
runs-on: ubuntu-latest
2426
steps:
27+
- name: Authenticate with GCP
28+
uses: google-github-actions/auth@v2
29+
with:
30+
workload_identity_provider: "projects/841522437311/locations/global/workloadIdentityPools/github-actions/providers/github-actions"
31+
service_account: "terraform-infra@infrastructure-464010.iam.gserviceaccount.com"
32+
33+
- id: get-secrets
34+
name: Get secrets from GCP Secret Manager
35+
# This step retrieves secrets from GCP Secret Manager and sets them as outputs
36+
# The secrets can then be accessed in subsequent steps using ${{ steps.get-secrets.outputs.<secret_name> }}
37+
uses: "google-github-actions/get-secretmanager-secrets@v2"
38+
with:
39+
secrets: |-
40+
github-pat:projects/626836145334/secrets/GITHUB_CI_PAT
41+
2542
- name: Checkout repository
2643
uses: actions/checkout@v4
2744
with:
2845
repository: fluentdo/documentation
29-
token: ${{ secrets.github-token }}
46+
token: ${{ steps.get-secrets.outputs.github-pat }}
3047

3148
- name: Add mapping version
3249
run: |
@@ -49,7 +66,7 @@ jobs:
4966
branch: ci_update-version-${{ inputs.agent-version }}
5067
delete-branch: true
5168
title: "ci: add mapping version for agent ${{ inputs.agent-version }}"
52-
token: ${{ secrets.github-token }}
69+
token: ${{ steps.get-secrets.outputs.github-pat }}
5370
labels: ci,automerge
5471
body: |
5572
Mapping version added for FluentDo agent ${{ inputs.agent-version }}:
@@ -73,4 +90,4 @@ jobs:
7390
# if: ${{ steps.cpr.outputs.pull-request-number }}
7491
# run: gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}"
7592
# env:
76-
# GH_TOKEN: ${{ secrets.github-token }}
93+
# GH_TOKEN: ${{ steps.get-secrets.outputs.github-pat }}

0 commit comments

Comments
 (0)