Skip to content

Commit 31ebf3f

Browse files
authored
fix: ensure every action disables git credential persistence (#821)
* Ensure every action disables Git credential persistence Reduces the possibility of inadvertently leaking the credentials in consuming workflows. Signed-off-by: Jack Baldry <[email protected]> * Update READMEs to encourage not persisting credentials Signed-off-by: Jack Baldry <[email protected]> --------- Signed-off-by: Jack Baldry <[email protected]>
1 parent 09fb633 commit 31ebf3f

File tree

15 files changed

+24
-1
lines changed

15 files changed

+24
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ will ensure actions in this repo are always used at the same commit. To do this:
6161
# action), so if multiple actions check `shared-workflows` out, they don't
6262
# overwrite each other
6363
path: _shared-workflows-your-action
64+
persist-credentials: false
6465

6566
- name: Use another action
6667
uses: ./_shared-workflows-your-action/actions/some-action

actions/argo-lint/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ runs:
2323
repository: ${{ env.action_repo }}
2424
ref: ${{ env.action_ref }}
2525
path: _shared-workflows-argo-lint
26+
persist-credentials: false
2627

2728
- name: Setup Argo
2829
uses: ./_shared-workflows-argo-lint/actions/setup-argo

actions/build-push-to-dockerhub/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
steps:
2424
- id: checkout
2525
uses: actions/checkout@v4
26+
with:
27+
persist-credentials: false
2628

2729
- id: push-to-dockerhub
2830
uses: grafana/shared-workflows/actions/[email protected]

actions/build-push-to-dockerhub/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ runs:
7575
repository: ${{ env.action_repo }}
7676
ref: ${{ env.action_ref }}
7777
path: _shared-workflows-build-push-to-dockerhub
78+
persist-credentials: false
7879

7980
- name: Login to DockerHub
8081
if: ${{ inputs.push == 'true' }}

actions/dockerhub-login/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ runs:
1616
repository: ${{ env.action_repo }}
1717
ref: ${{ env.action_ref }}
1818
path: _shared-workflows-dockerhub-login
19+
persist-credentials: false
1920

2021
- name: Get secrets for DockerHub login
2122
id: get-secrets

actions/generate-openapi-clients/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
runs-on: ubuntu-latest
3737
steps:
3838
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v1.0.1
39+
with:
40+
persist-credentials: false
41+
3942
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v1.0.1
4043
with:
4144
go-version: 1.18

actions/lint-pr-title/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ jobs:
8383
lint-pr-title:
8484
runs-on: ubuntu-latest
8585
steps:
86-
- uses: actions/checkout@v3
86+
- uses: actions/checkout@v4
87+
with:
88+
persist-credentials: false
8789
8890
- id: lint-pr-title
8991
uses: grafana/shared-workflows/actions/[email protected]

actions/push-to-gar-docker/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
steps:
2828
- id: checkout
2929
uses: actions/checkout@v4
30+
with:
31+
persist-credentials: false
3032

3133
- id: push-to-gar
3234
uses: grafana/shared-workflows/actions/[email protected]

actions/push-to-gar-docker/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ runs:
107107
repository: ${{ env.action_repo }}
108108
ref: ${{ env.action_ref }}
109109
path: shared-workflows
110+
persist-credentials: false
110111

111112
- name: Get repository name
112113
id: get-repository-name

actions/push-to-gcs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
runs-on: ubuntu-x64-small
2929
steps:
3030
- uses: actions/checkout@v4
31+
with:
32+
persist-credentials: false
33+
3134
- uses: grafana/shared-workflows/actions/login-to-gcs@main
3235
id: login-to-gcs
3336

0 commit comments

Comments
 (0)