Skip to content

Commit db0ef80

Browse files
committed
chore(ci): address zizmor findings
This is part 1 of N. The main focus in this PR is on unpinned references and inadvertent/unnecessary credential persistence. Signed-off-by: William Woodruff <[email protected]>
1 parent dab61a7 commit db0ef80

File tree

6 files changed

+22
-17
lines changed

6 files changed

+22
-17
lines changed

.github/workflows/pr-preview-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
documentation-links:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: readthedocs/actions/preview@v1
20+
- uses: readthedocs/actions/preview@b8bba1484329bda1a3abe986df7ebc80a8950333 # v1.5
2121
with:
2222
project-slug: "python-packaging-user-guide"

.github/workflows/test-translations.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ jobs:
3131

3232
steps:
3333
- name: Grab the repo src
34-
uses: actions/checkout@v4
34+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3535
with:
3636
ref: ${{ env.I18N_BRANCH }}
37+
persist-credentials: false
3738

3839
- name: List languages
3940
id: languages
@@ -53,12 +54,13 @@ jobs:
5354

5455
steps:
5556
- name: Grab the repo src
56-
uses: actions/checkout@v4
57+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5758
with:
5859
ref: ${{ env.I18N_BRANCH }}
60+
persist-credentials: false
5961

6062
- name: Set up Python
61-
uses: actions/setup-python@v5
63+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
6264
with:
6365
python-version: >-
6466
3.10
@@ -67,7 +69,7 @@ jobs:
6769
run: python -m pip install --upgrade nox virtualenv sphinx-lint
6870

6971
- name: Set Sphinx problem matcher
70-
uses: sphinx-doc/github-problem-matcher@v1.0
72+
uses: sphinx-doc/github-problem-matcher@1f74d6599f4a5e89a20d3c99aab4e6a70f7bda0f # v1.1
7173

7274
- name: Build translated docs in ${{ matrix.language }}
7375
run: nox -s build -- -q -D language=${{ matrix.language }}

.github/workflows/test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ jobs:
3131
- linkcheck
3232

3333
steps:
34-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
35+
with:
36+
persist-credentials: false
3537

3638
- name: Set up Python
37-
uses: actions/setup-python@v4
39+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
3840
with:
3941
python-version: "3.11"
4042
cache: 'pip'
@@ -62,6 +64,6 @@ jobs:
6264

6365
steps:
6466
- name: Decide whether the needed jobs succeeded or failed
65-
uses: re-actors/alls-green@release/v1
67+
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
6668
with:
6769
jobs: ${{ toJSON(needs) }}

.github/workflows/translation.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ jobs:
1919

2020
steps:
2121
- name: Grab the repo src
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2323
with:
2424
fetch-depth: 0 # To reach the common commit
25+
persist-credentials: true # For `git push`
2526
- name: Set up git user as [bot]
2627
# Refs:
2728
# * https://github.community/t/github-actions-bot-email-address/17204/6
2829
# * https://github.com/actions/checkout/issues/13#issuecomment-724415212
29-
uses: fregante/setup-git-user@v1.1.0
30+
uses: fregante/setup-git-user@024bc0b8e177d7e77203b48dab6fb45666854b35 # v2.0.2
3031

3132
- name: Switch to the translation source branch
3233
run: |
@@ -51,7 +52,7 @@ jobs:
5152
git merge '${{ github.event.repository.default_branch }}'
5253
5354
- name: Set up Python
54-
uses: actions/setup-python@v4
55+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
5556
with:
5657
python-version: >-
5758
3.10

.github/workflows/update-uv-build-version.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ jobs:
1717
pull-requests: write
1818
steps:
1919
- name: Checkout repository
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2121
with:
2222
persist-credentials: false
2323
- name: Set up uv
24-
uses: astral-sh/setup-uv@v5
24+
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
2525
- name: Update uv_build version
2626
id: update_script
2727
run: uv run scripts/update_uv_build_version.py
2828
- # If there are no changes, no pull request will be created and the action exits silently.
2929
name: Create Pull Request
30-
uses: peter-evans/create-pull-request@v7
30+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
3131
with:
3232
token: ${{ secrets.GITHUB_TOKEN }}
3333
commit-message: Update uv_build version to ${{ steps.update_script.outputs.version }}

.github/workflows/zizmor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ jobs:
1919
actions: read
2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2323
with:
2424
persist-credentials: false
2525

2626
- name: Install the latest version of uv
27-
uses: astral-sh/setup-uv@v5
27+
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
2828

2929
- name: Run zizmor 🌈
3030
run: uvx zizmor --format sarif source/guides/github-actions-ci-cd-sample/* > results.sarif
3131
env:
3232
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3333

3434
- name: Upload SARIF file
35-
uses: github/codeql-action/upload-sarif@v3
35+
uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v4.30.8
3636
with:
3737
sarif_file: results.sarif
3838
category: zizmor

0 commit comments

Comments
 (0)