Skip to content

Commit abc3c6f

Browse files
committed
chore: lock down workflows
1 parent b0b8aff commit abc3c6f

16 files changed

+102
-38
lines changed

.github/actions/build-vsix/action.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ runs:
5454
shell: bash
5555

5656
- name: Add Rustup target
57-
run: rustup target add ${{ inputs.cargo_target }}
57+
run: rustup target add "${CARGO_TARGET}"
5858
shell: bash
59+
env:
60+
CARGO_TARGET: ${{ inputs.cargo_target }}
5961

6062
- name: Build Native Binaries
6163
run: nox --session native_build
@@ -78,13 +80,17 @@ runs:
7880
shell: bash
7981

8082
- name: Build VSIX
81-
run: npx vsce package --target ${{ inputs.vsix_target }} --out ms-python-insiders.vsix --pre-release
83+
run: npx vsce package --target "${VSIX_TARGET}" --out ms-python-insiders.vsix --pre-release
8284
shell: bash
85+
env:
86+
VSIX_TARGET: ${{ inputs.vsix_target }}
8387

8488
- name: Rename VSIX
8589
# Move to a temp name in case the specified name happens to match the default name.
86-
run: mv ms-python-insiders.vsix ms-python-temp.vsix && mv ms-python-temp.vsix ${{ inputs.vsix_name }}
90+
run: mv ms-python-insiders.vsix ms-python-temp.vsix && mv ms-python-temp.vsix "${VSIX_NAME}"
8791
shell: bash
92+
env:
93+
VSIX_NAME: ${{ inputs.vsix_name }}
8894

8995
- name: Upload VSIX
9096
uses: actions/upload-artifact@v4

.github/actions/smoke-tests/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ runs:
3232
shell: bash
3333

3434
- name: Install Python requirements
35-
uses: brettcannon/pip-secure-install@v1
35+
uses: brettcannon/pip-secure-install@92f400e3191171c1858cc0e0d9ac6320173fdb0c # v1.0.0
3636
with:
3737
options: '-t ./python_files/lib/python --implementation py'
3838

@@ -61,6 +61,6 @@ runs:
6161
env:
6262
DISPLAY: 10
6363
INSTALL_JUPYTER_EXTENSION: true
64-
uses: GabrielBB/[email protected]
64+
uses: GabrielBB/xvfb-action@b706e4e27b14669b486812790492dc50ca16b465 # v1.7
6565
with:
6666
run: node --no-force-async-hooks-checks ./out/test/smokeTest.js

.github/workflows/build.yml

+23-8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
- 'release/*'
99
- 'release-*'
1010

11+
permissions: {}
12+
1113
env:
1214
NODE_VERSION: 20.18.0
1315
PYTHON_VERSION: '3.10' # YML treats 3.10 the number as 3.1, so quotes around 3.10
@@ -83,12 +85,15 @@ jobs:
8385
steps:
8486
- name: Checkout
8587
uses: actions/checkout@v4
88+
with:
89+
persist-credentials: false
8690

8791
- name: Checkout Python Environment Tools
8892
uses: actions/checkout@v4
8993
with:
9094
repository: 'microsoft/python-environment-tools'
9195
path: 'python-env-tools'
96+
persist-credentials: false
9297
sparse-checkout: |
9398
crates
9499
Cargo.toml
@@ -111,6 +116,8 @@ jobs:
111116
steps:
112117
- name: Checkout
113118
uses: actions/checkout@v4
119+
with:
120+
persist-credentials: false
114121

115122
- name: Lint
116123
uses: ./.github/actions/lint
@@ -129,14 +136,16 @@ jobs:
129136

130137
- name: Checkout
131138
uses: actions/checkout@v4
139+
with:
140+
persist-credentials: false
132141

133142
- name: Install core Python requirements
134-
uses: brettcannon/pip-secure-install@v1
143+
uses: brettcannon/pip-secure-install@92f400e3191171c1858cc0e0d9ac6320173fdb0c # v1.0.0
135144
with:
136145
options: '-t ./python_files/lib/python --no-cache-dir --implementation py'
137146

138147
- name: Install Jedi requirements
139-
uses: brettcannon/pip-secure-install@v1
148+
uses: brettcannon/pip-secure-install@92f400e3191171c1858cc0e0d9ac6320173fdb0c # v1.0.0
140149
with:
141150
requirements-file: './python_files/jedilsp_requirements/requirements.txt'
142151
options: '-t ./python_files/lib/jedilsp --no-cache-dir --implementation py'
@@ -146,7 +155,7 @@ jobs:
146155
python -m pip install --upgrade -r build/test-requirements.txt
147156
148157
- name: Run Pyright
149-
uses: jakebailey/pyright-action@v2
158+
uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2
150159
with:
151160
version: 1.1.308
152161
working-directory: 'python_files'
@@ -172,14 +181,15 @@ jobs:
172181
uses: actions/checkout@v4
173182
with:
174183
path: ${{ env.special-working-directory-relative }}
184+
persist-credentials: false
175185

176186
- name: Use Python ${{ matrix.python }}
177187
uses: actions/setup-python@v5
178188
with:
179189
python-version: ${{ matrix.python }}
180190

181191
- name: Install base Python requirements
182-
uses: brettcannon/pip-secure-install@v1
192+
uses: brettcannon/pip-secure-install@92f400e3191171c1858cc0e0d9ac6320173fdb0c # v1.0.0
183193
with:
184194
requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"'
185195
options: '-t "${{ env.special-working-directory-relative }}/python_files/lib/python" --no-cache-dir --implementation py'
@@ -211,12 +221,14 @@ jobs:
211221
uses: actions/checkout@v4
212222
with:
213223
path: ${{ env.special-working-directory-relative }}
224+
persist-credentials: false
214225

215226
- name: Checkout Python Environment Tools
216227
uses: actions/checkout@v4
217228
with:
218229
repository: 'microsoft/python-environment-tools'
219230
path: ${{ env.special-working-directory-relative }}/python-env-tools
231+
persist-credentials: false
220232
sparse-checkout: |
221233
crates
222234
Cargo.toml
@@ -358,7 +370,7 @@ jobs:
358370
env:
359371
TEST_FILES_SUFFIX: testvirtualenvs
360372
CI_PYTHON_VERSION: ${{ matrix.python }}
361-
uses: GabrielBB/[email protected]
373+
uses: GabrielBB/xvfb-action@b706e4e27b14669b486812790492dc50ca16b465 # v1.7
362374
with:
363375
run: npm run testSingleWorkspace
364376
working-directory: ${{ env.special-working-directory }}
@@ -367,7 +379,7 @@ jobs:
367379
- name: Run single-workspace tests
368380
env:
369381
CI_PYTHON_VERSION: ${{ matrix.python }}
370-
uses: GabrielBB/[email protected]
382+
uses: GabrielBB/xvfb-action@b706e4e27b14669b486812790492dc50ca16b465 # v1.7
371383
with:
372384
run: npm run testSingleWorkspace
373385
working-directory: ${{ env.special-working-directory }}
@@ -376,7 +388,7 @@ jobs:
376388
- name: Run multi-workspace tests
377389
env:
378390
CI_PYTHON_VERSION: ${{ matrix.python }}
379-
uses: GabrielBB/[email protected]
391+
uses: GabrielBB/xvfb-action@b706e4e27b14669b486812790492dc50ca16b465 # v1.7
380392
with:
381393
run: npm run testMultiWorkspace
382394
working-directory: ${{ env.special-working-directory }}
@@ -385,7 +397,7 @@ jobs:
385397
- name: Run debugger tests
386398
env:
387399
CI_PYTHON_VERSION: ${{ matrix.python }}
388-
uses: GabrielBB/[email protected]
400+
uses: GabrielBB/xvfb-action@b706e4e27b14669b486812790492dc50ca16b465 # v1.7
389401
with:
390402
run: npm run testDebugger
391403
working-directory: ${{ env.special-working-directory }}
@@ -415,12 +427,15 @@ jobs:
415427
steps:
416428
- name: Checkout
417429
uses: actions/checkout@v4
430+
with:
431+
persist-credentials: false
418432

419433
- name: Checkout Python Environment Tools
420434
uses: actions/checkout@v4
421435
with:
422436
repository: 'microsoft/python-environment-tools'
423437
path: ${{ env.special-working-directory-relative }}/python-env-tools
438+
persist-credentials: false
424439
sparse-checkout: |
425440
crates
426441
Cargo.toml

.github/workflows/codeql-analysis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
steps:
3838
- name: Checkout repository
3939
uses: actions/checkout@v4
40+
with:
41+
persist-credentials: false
4042

4143
# Initializes the CodeQL tools for scanning.
4244
- name: Initialize CodeQL

.github/workflows/community-feedback-auto-comment.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
issues: write
1313
steps:
1414
- name: Check For Existing Comment
15-
uses: peter-evans/find-comment@v3
15+
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
1616
id: finder
1717
with:
1818
issue-number: ${{ github.event.issue.number }}
@@ -21,7 +21,7 @@ jobs:
2121

2222
- name: Add Community Feedback Comment
2323
if: steps.finder.outputs.comment-id == ''
24-
uses: peter-evans/create-or-update-comment@v4
24+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
2525
with:
2626
issue-number: ${{ github.event.issue.number }}
2727
body: |

.github/workflows/gen-issue-velocity.yml

+5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ on:
55
- cron: '0 0 * * 2' # Runs every Tuesday at midnight
66
workflow_dispatch:
77

8+
permissions:
9+
issues: read
10+
811
jobs:
912
generate-summary:
1013
runs-on: ubuntu-latest
1114

1215
steps:
1316
- name: Checkout repository
1417
uses: actions/checkout@v4
18+
with:
19+
persist-credentials: false
1520

1621
- name: Set up Python
1722
uses: actions/setup-python@v5

.github/workflows/info-needed-closer.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
with:
1919
repository: 'microsoft/vscode-github-triage-actions'
2020
path: ./actions
21+
persist-credentials: false
2122
ref: stable
2223
- name: Install Actions
2324
run: npm install --production --prefix ./actions

.github/workflows/issue-labels.yml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
repository: 'microsoft/vscode-github-triage-actions'
2323
ref: stable
2424
path: ./actions
25+
persist-credentials: false
2526

2627
- name: Install Actions
2728
run: npm install --production --prefix ./actions

.github/workflows/lock-issues.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: 'Lock Issues'
19-
uses: dessant/lock-threads@v5
19+
uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1
2020
with:
2121
github-token: ${{ github.token }}
2222
issue-inactive-days: '30'

0 commit comments

Comments
 (0)