Skip to content

Commit 54b9f22

Browse files
authored
Hash-pin all GitHub Actions dependencies
Set cool down for dependabot updates on actions as well Signed-off-by: William Woodruff <william@astral.sh>
1 parent 8b60127 commit 54b9f22

4 files changed

Lines changed: 33 additions & 50 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "daily"
7+
cooldown:
8+
default-days: 7

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ jobs:
4141

4242
steps:
4343
- name: Checkout repository
44-
uses: actions/checkout@v5.0.1
44+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
4545
with:
4646
persist-credentials: false
4747

4848
# Initializes the CodeQL tools for scanning.
4949
- name: Initialize CodeQL
50-
uses: github/codeql-action/init@v4
50+
uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3
5151
with:
5252
languages: ${{ matrix.language }}
5353
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -61,7 +61,7 @@ jobs:
6161
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
6262
# If this step fails, then you should remove it and run the build manually (see below)
6363
- name: Autobuild
64-
uses: github/codeql-action/autobuild@v4
64+
uses: github/codeql-action/autobuild@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3
6565

6666
# ℹ️ Command-line programs to run using the OS shell.
6767
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -74,6 +74,6 @@ jobs:
7474
# ./location_of_script_within_repo/buildscript.sh
7575

7676
- name: Perform CodeQL Analysis
77-
uses: github/codeql-action/analyze@v4
77+
uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3
7878
with:
7979
category: "/language:${{matrix.language}}"

.github/workflows/main.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
lint:
2626
runs-on: ubuntu-latest
2727
steps:
28-
- uses: actions/checkout@v5.0.1
28+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
2929
with:
3030
persist-credentials: false
31-
- uses: actions/setup-python@v6.0.0
31+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
3232
with:
3333
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
3434
- name: Install dependencies
@@ -58,10 +58,10 @@ jobs:
5858
tox-environment: py-packaging240
5959
runs-on: ${{ matrix.platform }}
6060
steps:
61-
- uses: actions/checkout@v5.0.1
61+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
6262
with:
6363
persist-credentials: false
64-
- uses: actions/setup-python@v6.0.0
64+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
6565
with:
6666
python-version: ${{ matrix.python-version }}
6767
- name: Install dependencies
@@ -78,10 +78,10 @@ jobs:
7878
# Only run on Ubuntu because most of the tests are skipped on Windows
7979
runs-on: ubuntu-latest
8080
steps:
81-
- uses: actions/checkout@v5.0.1
81+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
8282
with:
8383
persist-credentials: false
84-
- uses: actions/setup-python@v6.0.0
84+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
8585
with:
8686
python-version: ${{ env.MIN_PYTHON_VERSION }}
8787
- name: Install dependencies
@@ -92,10 +92,10 @@ jobs:
9292
docs:
9393
runs-on: ubuntu-latest
9494
steps:
95-
- uses: actions/checkout@v5.0.1
95+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
9696
with:
9797
persist-credentials: false
98-
- uses: actions/setup-python@v6.0.0
98+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
9999
with:
100100
python-version: ${{ env.MIN_PYTHON_VERSION }}
101101
- name: Install dependencies
@@ -104,7 +104,7 @@ jobs:
104104
run: python -m tox -e docs
105105

106106
# https://github.com/marketplace/actions/alls-green#why
107-
check: # This job does nothing and is only used for the branch protection
107+
check: # This job does nothing and is only used for the branch protection
108108
if: always()
109109

110110
needs:
@@ -116,22 +116,22 @@ jobs:
116116
runs-on: ubuntu-latest
117117

118118
steps:
119-
- name: Decide whether the needed jobs succeeded or failed
120-
uses: re-actors/alls-green@release/v1
121-
with:
122-
allowed-failures: integration # can be flaky
123-
jobs: ${{ toJSON(needs) }}
119+
- name: Decide whether the needed jobs succeeded or failed
120+
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
121+
with:
122+
allowed-failures: integration # can be flaky
123+
jobs: ${{ toJSON(needs) }}
124124

125125
release:
126126
needs:
127127
- check
128128
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
129129
runs-on: ubuntu-latest
130130
steps:
131-
- uses: actions/checkout@v5.0.1
131+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
132132
with:
133133
persist-credentials: false
134-
- uses: actions/setup-python@v6.0.0
134+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
135135
with:
136136
python-version: ${{ env.MIN_PYTHON_VERSION }}
137137
- name: Install dependencies

.github/workflows/release.yml

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@ jobs:
1414
runs-on: "ubuntu-latest"
1515
environment:
1616
name: "publish"
17-
outputs:
18-
hashes: ${{ steps.hash.outputs.hashes }}
1917

2018
steps:
2119
- name: "Checkout repository"
22-
uses: "actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e"
20+
uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e # v5.0.1
2321
with:
2422
persist-credentials: false
2523

2624
- name: "Setup Python"
27-
uses: "actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c"
25+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
2826
with:
2927
python-version: "3.x"
3028

@@ -36,46 +34,29 @@ jobs:
3634
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) \
3735
python -m build
3836
39-
- name: "Generate hashes"
40-
id: hash
41-
run: |
42-
cd dist && echo "hashes=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT
43-
4437
- name: "Upload dists"
45-
uses: "actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4"
38+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
4639
with:
4740
name: "dist"
4841
path: "dist/"
4942
if-no-files-found: error
5043
retention-days: 5
5144

52-
provenance:
53-
needs: [build]
54-
permissions:
55-
actions: read
56-
contents: write
57-
id-token: write # Needed to access the workflow's OIDC identity.
58-
uses: "slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0"
59-
with:
60-
base64-subjects: "${{ needs.build.outputs.hashes }}"
61-
upload-assets: true
62-
compile-generator: true # Workaround for https://github.com/slsa-framework/slsa-github-generator/issues/1163
63-
6445
publish:
6546
name: "Publish to PyPI"
6647
if: startsWith(github.ref, 'refs/tags/')
67-
needs: ["build", "provenance"]
48+
needs: ["build"]
6849
permissions:
6950
contents: write
7051
id-token: write
7152
runs-on: "ubuntu-latest"
7253

7354
steps:
74-
- name: "Download dists"
75-
uses: "actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53"
76-
with:
77-
name: "dist"
78-
path: "dist/"
55+
- name: "Download dists"
56+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
57+
with:
58+
name: "dist"
59+
path: "dist/"
7960

80-
- name: "Publish dists to PyPI"
81-
uses: "pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e"
61+
- name: "Publish dists to PyPI"
62+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

0 commit comments

Comments
 (0)