Skip to content

Commit 3c35eb5

Browse files
committed
ci: pin versions in workflows
1 parent a494e2f commit 3c35eb5

2 files changed

Lines changed: 14 additions & 16 deletions

File tree

.github/workflows/pre-commit-update.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- cron: '0 3 * * 1' # Every Monday at 03:00 UTC
66
workflow_dispatch:
77

8+
env:
9+
HATCH_VERSION: "1.14.1"
10+
811
jobs:
912
update-pre-commit-config:
1013
runs-on: ubuntu-latest
@@ -18,7 +21,9 @@ jobs:
1821
python-version: '3.13'
1922

2023
- name: Install Hatch
21-
run: pip install --upgrade hatch
24+
uses: pypa/hatch@install
25+
with:
26+
version: "${{ env.HATCH_VERSION }}"
2227

2328
- name: Set up Git user
2429
run: |
@@ -28,18 +33,7 @@ jobs:
2833
- name: Update .pre-commit-config.yaml
2934
run: hatch run pre-commit autoupdate --freeze
3035

31-
- name: Check for changes
32-
id: changes
33-
run: |
34-
git add .pre-commit-config.yaml
35-
if git diff --cached --quiet; then
36-
echo "changed=false" >> $GITHUB_OUTPUT
37-
else
38-
echo "changed=true" >> $GITHUB_OUTPUT
39-
fi
40-
4136
- name: Create Pull Request
42-
if: steps.changes.outputs.changed == 'true'
4337
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7
4438
with:
4539
commit-message: "chore(deps): Update .pre-commit-config.yaml"

.github/workflows/python-publish.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Build and Publish
22

33
on: [push]
44

5+
env:
6+
HATCH_VERSION: "1.14.1"
7+
58
jobs:
69
build:
710
name: Build distribution 📦
@@ -14,9 +17,10 @@ jobs:
1417
with:
1518
python-version: "3.x"
1619

17-
- name: Install hatch
18-
run: >-
19-
python3 -m pip install --upgrade hatch --user
20+
- name: Install Hatch
21+
uses: pypa/hatch@install
22+
with:
23+
version: "${{ env.HATCH_VERSION }}"
2024

2125
- name: Build a binary wheel and a source tarball
2226
run: hatch build
@@ -46,4 +50,4 @@ jobs:
4650
path: dist/
4751

4852
- name: Publish distribution 📦 to PyPI
49-
uses: pypa/gh-action-pypi-publish@release/v1
53+
uses: pypa/gh-action-pypi-publish@v1.13.0

0 commit comments

Comments
 (0)