Skip to content

Commit db9cef3

Browse files
Trottdanielleadams
authored andcommitted
build: set persist-credentials: false on workflows
Out of extra caution, instruct `actions/checkout` to not save GitHub authentication credentials in the git config for use by future steps. PR-URL: #40972 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 90097ab commit db9cef3

19 files changed

+53
-1
lines changed

.github/workflows/authors.yml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
- uses: actions/checkout@v2
1515
with:
1616
fetch-depth: '0' # This is required to actually get all the authors
17+
persist-credentials: false
1718
- run: "tools/update-authors.js" # Run the AUTHORS tool
1819
- uses: gr2m/create-or-update-pull-request-action@v1 # Create a PR or update the Action's existing PR
1920
env:

.github/workflows/auto-start-ci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v2
20+
with:
21+
persist-credentials: false
2022

2123
# Install dependencies
2224
- name: Install Node.js

.github/workflows/build-tarball.yml

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- uses: actions/checkout@v2
34+
with:
35+
persist-credentials: false
3436
- name: Set up Python ${{ env.PYTHON_VERSION }}
3537
uses: actions/setup-python@v2
3638
with:
@@ -57,6 +59,8 @@ jobs:
5759
runs-on: ubuntu-latest
5860
steps:
5961
- uses: actions/checkout@v2
62+
with:
63+
persist-credentials: false
6064
- name: Set up Python ${{ env.PYTHON_VERSION }}
6165
uses: actions/setup-python@v2
6266
with:

.github/workflows/build-windows.yml

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
runs-on: ${{ matrix.windows }}
3030
steps:
3131
- uses: actions/checkout@v2
32+
with:
33+
persist-credentials: false
3234
- name: Set up Python ${{ env.PYTHON_VERSION }}
3335
uses: actions/setup-python@v2
3436
with:

.github/workflows/commit-lint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- uses: actions/checkout@v2
1818
with:
1919
fetch-depth: ${{ steps.nb-of-commits.outputs.plusOne }}
20+
persist-credentials: false
2021
- run: git reset HEAD^2
2122
- name: Install Node.js
2223
uses: actions/setup-node@v2

.github/workflows/commit-queue.yml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
# Needs the whole git history for ncu to work
2727
# See https://github.com/nodejs/node-core-utils/pull/486
2828
fetch-depth: 0
29+
persist-credentials: false
2930
# A personal token is required because pushing with GITHUB_TOKEN will
3031
# prevent commits from running CI after they land. It needs
3132
# to be set here because `checkout` configures GitHub authentication

.github/workflows/coverage-linux.yml

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- uses: actions/checkout@v2
31+
with:
32+
persist-credentials: false
3133
- name: Set up Python ${{ env.PYTHON_VERSION }}
3234
uses: actions/setup-python@v2
3335
with:

.github/workflows/coverage-windows.yml

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
runs-on: windows-latest
3131
steps:
3232
- uses: actions/checkout@v2
33+
with:
34+
persist-credentials: false
3335
- name: Set up Python ${{ env.PYTHON_VERSION }}
3436
uses: actions/setup-python@v2
3537
with:

.github/workflows/daily.yml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
container: gcc:11
1616
steps:
1717
- uses: actions/checkout@v2
18+
with:
19+
persist-credentials: false
1820
- name: Use Node.js ${{ env.NODE_VERSION }}
1921
uses: actions/setup-node@v2
2022
with:

.github/workflows/find-inactive-collaborators.yml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- uses: actions/checkout@v2
2121
with:
2222
fetch-depth: ${{ env.NUM_COMMITS }}
23+
persist-credentials: false
2324

2425
- name: Use Node.js ${{ env.NODE_VERSION }}
2526
uses: actions/setup-node@v2

.github/workflows/find-inactive-tsc.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ jobs:
1818
steps:
1919
- name: Checkout the repo
2020
uses: actions/checkout@v2
21+
with:
22+
persist-credentials: false
2123

2224
- name: Clone nodejs/TSC repository
2325
uses: actions/checkout@v2
2426
with:
2527
fetch-depth: 0
26-
repository: nodejs/TSC
2728
path: .tmp
29+
persist-credentials: false
30+
repository: nodejs/TSC
2831

2932
- name: Use Node.js ${{ env.NODE_VERSION }}
3033
uses: actions/setup-node@v2

.github/workflows/license-builder.yml

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
15+
with:
16+
persist-credentials: false
1517
- run: "./tools/license-builder.sh" # Run the license builder tool
1618
- uses: gr2m/[email protected] # Create a PR or update the Action's existing PR
1719
env:

.github/workflows/linters.yml

+17
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v2
23+
with:
24+
persist-credentials: false
2325
- name: Use Node.js ${{ env.NODE_VERSION }}
2426
uses: actions/setup-node@v2
2527
with:
@@ -33,6 +35,8 @@ jobs:
3335
runs-on: ubuntu-latest
3436
steps:
3537
- uses: actions/checkout@v2
38+
with:
39+
persist-credentials: false
3640
- name: Set up Python ${{ env.PYTHON_VERSION }}
3741
uses: actions/setup-python@v2
3842
with:
@@ -46,6 +50,8 @@ jobs:
4650
runs-on: ubuntu-latest
4751
steps:
4852
- uses: actions/checkout@v2
53+
with:
54+
persist-credentials: false
4955
- name: Use Node.js ${{ env.NODE_VERSION }}
5056
uses: actions/setup-node@v2
5157
with:
@@ -68,6 +74,8 @@ jobs:
6874
runs-on: ubuntu-latest
6975
steps:
7076
- uses: actions/checkout@v2
77+
with:
78+
persist-credentials: false
7179
- name: Use Node.js ${{ env.NODE_VERSION }}
7280
uses: actions/setup-node@v2
7381
with:
@@ -81,6 +89,8 @@ jobs:
8189
runs-on: ubuntu-latest
8290
steps:
8391
- uses: actions/checkout@v2
92+
with:
93+
persist-credentials: false
8494
- name: Set up Python ${{ env.PYTHON_VERSION }}
8595
uses: actions/setup-python@v2
8696
with:
@@ -96,6 +106,8 @@ jobs:
96106
runs-on: ubuntu-latest
97107
steps:
98108
- uses: actions/checkout@v2
109+
with:
110+
persist-credentials: false
99111
- name: Use Python ${{ env.PYTHON_VERSION }}
100112
uses: actions/setup-python@v2
101113
with:
@@ -112,6 +124,8 @@ jobs:
112124
runs-on: ubuntu-20.04
113125
steps:
114126
- uses: actions/checkout@v2
127+
with:
128+
persist-credentials: false
115129
- run: shellcheck -V
116130
- name: Lint Shell scripts
117131
run: tools/lint-sh.js .
@@ -120,6 +134,8 @@ jobs:
120134
runs-on: ubuntu-latest
121135
steps:
122136
- uses: actions/checkout@v2
137+
with:
138+
persist-credentials: false
123139
- uses: mszostok/[email protected]
124140
with:
125141
checks: "files,duppatterns"
@@ -130,5 +146,6 @@ jobs:
130146
- uses: actions/checkout@v2
131147
with:
132148
fetch-depth: 2
149+
persist-credentials: false
133150
# GH Actions squashes all PR commits, HEAD^ refers to the base branch.
134151
- run: git diff HEAD^ HEAD -G"pr-url:" -- "*.md" | ./tools/lint-pr-url.mjs ${{ github.event.pull_request.html_url }}

.github/workflows/misc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v2
22+
with:
23+
persist-credentials: false
2224
- name: Use Node.js ${{ env.NODE_VERSION }}
2325
uses: actions/setup-node@v2
2426
with:

.github/workflows/test-asan.yml

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
CONFIG_FLAGS: --enable-asan
4141
steps:
4242
- uses: actions/checkout@v2
43+
with:
44+
persist-credentials: false
4345
- name: Set up Python ${{ env.PYTHON_VERSION }}
4446
uses: actions/setup-python@v2
4547
with:

.github/workflows/test-internet.yml

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- uses: actions/checkout@v2
31+
with:
32+
persist-credentials: false
3133
- name: Set up Python ${{ env.PYTHON_VERSION }}
3234
uses: actions/setup-python@v2
3335
with:

.github/workflows/test-linux.yml

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
runs-on: ubuntu-latest
3030
steps:
3131
- uses: actions/checkout@v2
32+
with:
33+
persist-credentials: false
3234
- name: Set up Python ${{ env.PYTHON_VERSION }}
3335
uses: actions/setup-python@v2
3436
with:

.github/workflows/test-macos.yml

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
runs-on: macos-latest
3636
steps:
3737
- uses: actions/checkout@v2
38+
with:
39+
persist-credentials: false
3840
- name: Set up Python ${{ env.PYTHON_VERSION }}
3941
uses: actions/setup-python@v2
4042
with:

.github/workflows/tools.yml

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
fi
5151
steps:
5252
- uses: actions/checkout@v2
53+
with:
54+
persist-credentials: false
5355
- run: ${{ matrix.run }}
5456
- uses: gr2m/create-or-update-pull-request-action@v1 # Create a PR or update the Action's existing PR
5557
env:

0 commit comments

Comments
 (0)