Skip to content

Commit 13c8885

Browse files
committed
Fix CI via Zizmor
1 parent 50635d8 commit 13c8885

File tree

2 files changed

+49
-7
lines changed

2 files changed

+49
-7
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@ on:
1212
- master
1313
- '*-maint'
1414

15+
permissions: {}
16+
1517
jobs:
1618
lint:
19+
name: lint
1720
permissions:
1821
contents: read
1922
runs-on: ubuntu-latest
2023
steps:
21-
- uses: actions/checkout@v5
22-
- uses: astral-sh/setup-uv@v6
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
with:
26+
persist-credentials: false
27+
- uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
2328
with:
2429
cache-dependency-glob: ".github/workflows/*.yml"
2530
cache-suffix: pre-commit-uv
@@ -28,10 +33,12 @@ jobs:
2833
with:
2934
path: ~/.cache/pre-commit
3035
key: pre-commit-uv-v1-${{ hashFiles('.pre-commit-config.yaml') }}
36+
lookup-only: true
3137
- run: pre-commit run --all-files --show-diff-on-failure --color=always
3238
env:
3339
RUFF_OUTPUT_FORMAT: github
3440
test:
41+
name: test
3542
permissions:
3643
contents: read
3744
runs-on: ${{ matrix.os }}
@@ -54,7 +61,9 @@ jobs:
5461
BABEL_CLDR_QUIET: "1"
5562
PIP_DISABLE_PIP_VERSION_CHECK: "1"
5663
steps:
57-
- uses: actions/checkout@v5
64+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
65+
with:
66+
persist-credentials: false
5867
- uses: actions/cache@v4
5968
with:
6069
path: cldr
@@ -75,19 +84,22 @@ jobs:
7584
env:
7685
COVERAGE_XML_PATH: ${{ runner.temp }}
7786
BABEL_TOX_EXTRA_DEPS: pytest-github-actions-annotate-failures
78-
- uses: codecov/codecov-action@v5
87+
- uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
7988
with:
8089
directory: ${{ runner.temp }}
8190
flags: ${{ matrix.os }}-${{ matrix.python-version }}
8291
token: ${{ secrets.CODECOV_TOKEN }}
8392
verbose: true
8493
build:
94+
name: build
8595
permissions:
8696
contents: read
8797
runs-on: ubuntu-24.04
8898
needs: lint
8999
steps:
90-
- uses: actions/checkout@v5
100+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
101+
with:
102+
persist-credentials: false
91103
- uses: actions/setup-python@v6
92104
with:
93105
python-version: "3.13"
@@ -101,6 +113,7 @@ jobs:
101113
name: dist
102114
path: dist
103115
publish:
116+
name: publish
104117
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
105118
needs:
106119
- build
@@ -109,14 +122,14 @@ jobs:
109122
name: release
110123
url: https://pypi.org/p/babel/
111124
permissions:
112-
id-token: write
125+
id-token: write # Required for Trusted Publishing action
113126
steps:
114127
- uses: actions/download-artifact@v5
115128
with:
116129
name: dist
117130
path: dist/
118131
- name: Publish package distributions to PyPI
119-
uses: pypa/gh-action-pypi-publish@release/v1
132+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
120133
with:
121134
verbose: true
122135
print-hash: true

.github/workflows/security.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Security
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '*-maint'
8+
tags:
9+
- 'v*'
10+
pull_request:
11+
branches:
12+
- master
13+
- '*-maint'
14+
15+
permissions: {}
16+
17+
jobs:
18+
zizmor:
19+
name: Run zizmor
20+
runs-on: ubuntu-latest
21+
permissions:
22+
security-events: write # via Zizmor example
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
with:
27+
persist-credentials: false
28+
- name: Run zizmor
29+
uses: zizmorcore/zizmor-action@e673c3917a1aef3c65c972347ed84ccd013ecda4 # v0.2.0

0 commit comments

Comments
 (0)