Skip to content

Commit d581c4d

Browse files
committed
fix: update GitHub Actions workflows to use environment variables for inputs and disable credential persistence
Signed-off-by: Weifeng Wang <[email protected]>
1 parent aaee06f commit d581c4d

File tree

8 files changed

+33
-7
lines changed

8 files changed

+33
-7
lines changed

.github/actions/setup-identity/action.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ runs:
2121
shell: bash
2222
run: |
2323
git config --global --add safe.directory '/__w/codelab-monitoring/codelab-monitoring'
24-
git config user.name "${{ inputs.name }}"
25-
git config user.email "${{ inputs.email }}"
24+
git config user.name "${INPUTS_NAME}"
25+
git config user.email "${INPUTS_EMAIL}"
26+
env:
27+
INPUTS_NAME: ${{ inputs.name }}
28+
INPUTS_EMAIL: ${{ inputs.email }}
2629
- name: Log in with GH CLI
2730
shell: bash
2831
run: |
29-
echo "${{ inputs.token }}" | gh auth login --with-token
32+
echo "${INPUTS_TOKEN}" | gh auth login --with-token
33+
34+
env:
35+
INPUTS_TOKEN: ${{ inputs.token }}

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
cooldown:
8+
default-days: 7
79

810
- package-ecosystem: "gomod"
911
directory: "/"
1012
schedule:
1113
interval: "weekly"
1214
open-pull-requests-limit: 2
15+
cooldown:
16+
default-days: 7

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/[email protected]
17+
with:
18+
persist-credentials: false
1719
- uses: actions/setup-go@v6
1820
with:
1921
go-version: '1.25'
2022

2123
- name: Build binary
22-
run: make build
24+
run: make build

.github/workflows/publish-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v4.2.2
19+
with:
20+
persist-credentials: false
1921
-
2022
name: Set variables
2123
id: vars

.github/workflows/release-drafter.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ jobs:
2929
-
3030
name: Checkout
3131
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v4.2.2
32+
with:
33+
persist-credentials: false
3234
-
3335
name: Copy release notes from Draft
3436
run: |
35-
tag_name=${{ steps.draft.outputs.tag_name }}
36-
echo "${{ steps.draft.outputs.body }}" > docs/release_notes/${tag_name:1}.md
37+
tag_name=${STEPS_DRAFT_OUTPUTS_TAG_NAME}
38+
echo "${STEPS_DRAFT_OUTPUTS_BODY}" > docs/release_notes/${tag_name:1}.md
39+
env:
40+
STEPS_DRAFT_OUTPUTS_TAG_NAME: ${{ steps.draft.outputs.tag_name }}
41+
STEPS_DRAFT_OUTPUTS_BODY: ${{ steps.draft.outputs.body }}
3742
-
3843
name: Upsert Pull Request
3944
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 #v8.0.0

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v4.2.2
14+
with:
15+
persist-credentials: false
1416
- name: Set output
1517
id: vars
1618
run: |
@@ -32,4 +34,4 @@ jobs:
3234
with:
3335
isPreRelease: ${{ needs.check_tag.outputs.isPreRelease == 'true' }}
3436
secrets:
35-
ghPAT: ${{ secrets.QCBOT_TOKEN }}
37+
ghPAT: ${{ secrets.QCBOT_TOKEN }}

.github/workflows/trigger-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
token: ${{ secrets.QCBOT_TOKEN }}
2424
# Set fetch-depth: 0 to fetch all history for all branches and tags.
2525
fetch-depth: 0
26+
persist-credentials: false
2627
- uses: actions/setup-go@v6
2728
with:
2829
go-version: '1.25'

.github/workflows/updatecli.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
-
2727
name: Checkout
2828
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v4.2.2
29+
with:
30+
persist-credentials: false
2931
-
3032
name: Setup updatecli
3133
uses: updatecli/updatecli-action@v2
@@ -85,6 +87,8 @@ jobs:
8587
-
8688
name: Checkout
8789
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v4.2.2
90+
with:
91+
persist-credentials: false
8892
-
8993
name: Setup updatecli
9094
uses: updatecli/updatecli-action@v2

0 commit comments

Comments
 (0)