Skip to content

Commit 0fa8327

Browse files
authored
Pin pre-commit hooks and GH Actions to commit hashes, set Dependabot cooldown to 7 days (#138)
* Set default cooldown period to 7 days in dependabot configuration * Update GitHub Actions to use commit hashes for dependencies * prek autoupdate --freeze
1 parent 7a3b416 commit 0fa8327

4 files changed

Lines changed: 26 additions & 24 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ updates:
88
actions:
99
patterns:
1010
- "*"
11+
cooldown:
12+
default-days: 7

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
lint:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v6
12+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1313
with:
1414
persist-credentials: false
15-
- uses: actions/setup-python@v6
15+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1616
with:
1717
python-version: "3.x"
18-
- uses: tox-dev/action-pre-commit-uv@v1
18+
- uses: tox-dev/action-pre-commit-uv@41a04ab74d5ec7ca33c8db8a59b6e3291d576033 # v1.0.4

.github/workflows/update-lint-and-build.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
matrix:
1717
version: [3.15, 3.14, 3.13, 3.12, 3.11, '3.10']
1818
steps:
19-
- uses: styfle/cancel-workflow-action@0.13.1
19+
- uses: styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66 # 0.13.1
2020
with:
2121
access_token: ${{ secrets.GITHUB_TOKEN }}
22-
- uses: actions/setup-python@v6
22+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2323
with:
2424
python-version: 3
2525
- name: Install dependencies
@@ -28,7 +28,7 @@ jobs:
2828
pip install requests cogapp polib transifex-python sphinx-intl blurb six
2929
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
3030
working-directory: /usr/local/bin
31-
- uses: actions/checkout@v6
31+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3232
with:
3333
ref: ${{ matrix.version }}
3434
fetch-depth: 0
@@ -59,7 +59,7 @@ jobs:
5959
- run: git commit -m "$(python manage_translation.py generate_commit_msg)"
6060
if: env.SIGNIFICANT_CHANGES
6161
- name: Push commit
62-
uses: ad-m/github-push-action@v1.1.0
62+
uses: ad-m/github-push-action@881a6320fdb16eb5318c5054f31c218aec2b324c # v1.3.0
6363
if: env.SIGNIFICANT_CHANGES
6464
with:
6565
branch: ${{ matrix.version }}
@@ -74,14 +74,14 @@ jobs:
7474
needs: ['update']
7575
continue-on-error: true
7676
steps:
77-
- uses: actions/setup-python@v6
77+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
7878
with:
7979
python-version: 3
8080
- run: pip install sphinx-lint
81-
- uses: actions/checkout@v6
81+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8282
with:
8383
ref: ${{ matrix.version }}
84-
- uses: rffontenelle/sphinx-lint-problem-matcher@v1.0.0
84+
- uses: rffontenelle/sphinx-lint-problem-matcher@4270bf50b2c93640a7cbb231c09f8e694699af9f # v1.0.0
8585
- run: sphinx-lint
8686

8787
build:
@@ -93,27 +93,27 @@ jobs:
9393
format: [html, latex, epub]
9494
needs: ['update']
9595
steps:
96-
- uses: actions/setup-python@v6
96+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
9797
with:
9898
python-version: 3.12 # pin for Sphinx 3.4.3 in 3.10 branch (see #63)
99-
- uses: actions/checkout@v6
99+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
100100
with:
101101
repository: python/cpython
102102
ref: ${{ matrix.version }}
103103
- run: make venv
104104
working-directory: ./Doc
105-
- uses: actions/checkout@v6
105+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
106106
with:
107107
ref: ${{ matrix.version }}
108108
path: Doc/locales/pl/LC_MESSAGES
109109
- run: git pull
110110
working-directory: ./Doc/locales/pl/LC_MESSAGES
111111
- run: sudo apt-get update && sudo apt-get install -y librsvg2-bin
112112
if: ${{ matrix.format == 'latex' && fromJSON(matrix.version) >= 3.14 }}
113-
- uses: sphinx-doc/github-problem-matcher@v1.1
113+
- uses: sphinx-doc/github-problem-matcher@1f74d6599f4a5e89a20d3c99aab4e6a70f7bda0f # v1.1
114114
- run: make -e SPHINXOPTS="--color -D language='pl' -W --keep-going" ${{ matrix.format }}
115115
working-directory: ./Doc
116-
- uses: actions/upload-artifact@v7.0.1
116+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
117117
if: success() || failure()
118118
with:
119119
name: build-${{ matrix.version }}-${{ matrix.format }}
@@ -126,13 +126,13 @@ jobs:
126126
version: [3.15, 3.14, 3.13, 3.12, 3.11, '3.10']
127127
needs: ['build']
128128
steps:
129-
- uses: actions/download-artifact@v8.0.1
129+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
130130
with:
131131
name: build-${{ matrix.version }}-latex
132132
- run: sudo apt-get update
133133
- run: sudo apt-get install -y latexmk texlive-xetex fonts-freefont-otf xindy
134134
- run: make
135-
- uses: actions/upload-artifact@v7.0.1
135+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
136136
with:
137137
name: build-${{ matrix.version }}-pdf
138138
path: .
@@ -145,11 +145,11 @@ jobs:
145145
needs: ['build']
146146
continue-on-error: true
147147
steps:
148-
- uses: actions/setup-python@v6
148+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
149149
with:
150150
python-version: 3.x
151-
- uses: astral-sh/setup-uv@v7
152-
- uses: actions/download-artifact@v8.0.1
151+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
152+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
153153
with:
154154
name: build-${{ matrix.version }}-epub
155155
- run: uvx epubcheck

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.15.9
3+
rev: 0c7b6c989466a93942def1f84baf36ddfcd60c83 # frozen: v0.15.14
44
hooks:
55
- id: ruff
66
args: [--fix, --exit-non-zero-on-fix]
77
- id: ruff-format
88

99
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v6.0.0
10+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
1111
hooks:
1212
- id: check-added-large-files
1313
- id: check-case-conflict
@@ -20,12 +20,12 @@ repos:
2020
- id: trailing-whitespace
2121

2222
- repo: https://github.com/python-jsonschema/check-jsonschema
23-
rev: 0.37.1
23+
rev: 943377262562a12b57292fc98fabd7dbf81451fe # frozen: 0.37.2
2424
hooks:
2525
- id: check-github-workflows
2626

2727
- repo: https://github.com/rhysd/actionlint
28-
rev: v1.7.12
28+
rev: 914e7df21a07ef503a81201c76d2b11c789d3fca # frozen: v1.7.12
2929
hooks:
3030
- id: actionlint
3131

0 commit comments

Comments
 (0)