Skip to content

Commit 4ecc1ef

Browse files
committed
harden git workflows
1 parent 89c9cbc commit 4ecc1ef

9 files changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/build-ami-v2.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
repository: ${{ inputs.image_builder_repo }}
6262
ref: ${{ inputs.image_builder_version }}
6363
fetch-depth: 0
64+
persist-credentials: false
6465
- name: Configure AWS credentials
6566
uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6.2.0
6667
with:

.github/workflows/build-ami-varsfile.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
repository: ${{ inputs.image_builder_repo }}
3939
ref: ${{ inputs.image_builder_version }}
4040
fetch-depth: 0
41+
persist-credentials: false
4142
- name: Create packer vars file
4243
if: inputs.packer_vars != ''
4344
env:

.github/workflows/build-ami.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,3 @@ jobs:
9696
- name: Build AMI
9797
working-directory: ./images/capi
9898
run: PACKER_VAR_FILES=vars.json make build-ami-${{ matrix.target }}
99-

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
steps:
2323
- name: Checkout repository
2424
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
25+
with:
26+
persist-credentials: false
2527

2628
# Initializes the CodeQL tools for scanning.
2729
- name: Initialize CodeQL

.github/workflows/md-link-checker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
12+
with:
13+
persist-credentials: false
1214
- uses: artyom/mdlinks@3d49483ce078798ed3aee5abc1c65476040654dd # v0.4.2
1315
with:
1416
dir: 'docs/book'

.github/workflows/pr-golangci-lint.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: PR golangci-lint
22

33
on:
44
pull_request:
5-
types: [opened, edited, synchronize, reopened]
5+
types: [opened, synchronize, reopened]
66

77
# Remove all permissions from GITHUB_TOKEN except metadata.
88
permissions: {}
@@ -18,6 +18,8 @@ jobs:
1818
- ""
1919
steps:
2020
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # tag=v4.2.2
21+
with:
22+
persist-credentials: false
2123
- name: Calculate go version
2224
id: vars
2325
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT

.github/workflows/pr-verify.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
name: PR verify
22

33
on:
4-
pull_request_target:
5-
types: [opened, edited, synchronize, reopened]
4+
pull_request:
5+
types: [opened, synchronize, reopened]
66

77
jobs:
88
verify:
99
runs-on: ubuntu-latest
1010
name: verify PR contents
1111
steps:
1212
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # tag=v4.2.2
13+
with:
14+
persist-credentials: false
1315

1416
- name: Check if PR title is valid
1517
env:

.github/workflows/release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
1818
with:
1919
fetch-depth: 0
20+
persist-credentials: false
2021
- name: Set up Go
2122
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
2223
with:

.github/workflows/scan.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2222
with:
2323
ref: ${{ matrix.branch }}
24+
persist-credentials: false
2425
- name: Setup go
2526
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
2627
with:

0 commit comments

Comments
 (0)