Skip to content

Commit d09fcd7

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

File tree

2 files changed

+45
-7
lines changed

2 files changed

+45
-7
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,34 @@ 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
31+
enable-cache: false
2632
- run: uv tool install pre-commit --with pre-commit-uv --force-reinstall
2733
- uses: actions/cache@v4
2834
with:
2935
path: ~/.cache/pre-commit
3036
key: pre-commit-uv-v1-${{ hashFiles('.pre-commit-config.yaml') }}
37+
lookup-only: true
3138
- run: pre-commit run --all-files --show-diff-on-failure --color=always
3239
env:
3340
RUFF_OUTPUT_FORMAT: github
3441
test:
42+
name: Test
3543
permissions:
3644
contents: read
3745
runs-on: ${{ matrix.os }}
@@ -54,11 +62,14 @@ jobs:
5462
BABEL_CLDR_QUIET: "1"
5563
PIP_DISABLE_PIP_VERSION_CHECK: "1"
5664
steps:
57-
- uses: actions/checkout@v5
65+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
66+
with:
67+
persist-credentials: false
5868
- uses: actions/cache@v4
5969
with:
6070
path: cldr
6171
key: cldr-${{ hashFiles('scripts/*cldr*') }}
72+
lookup-only: true
6273
- name: Set up Python ${{ matrix.python-version }}
6374
uses: actions/setup-python@v6
6475
with:
@@ -75,19 +86,22 @@ jobs:
7586
env:
7687
COVERAGE_XML_PATH: ${{ runner.temp }}
7788
BABEL_TOX_EXTRA_DEPS: pytest-github-actions-annotate-failures
78-
- uses: codecov/codecov-action@v5
89+
- uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
7990
with:
8091
directory: ${{ runner.temp }}
8192
flags: ${{ matrix.os }}-${{ matrix.python-version }}
8293
token: ${{ secrets.CODECOV_TOKEN }}
8394
verbose: true
8495
build:
96+
name: Build package
8597
permissions:
8698
contents: read
8799
runs-on: ubuntu-24.04
88100
needs: lint
89101
steps:
90-
- uses: actions/checkout@v5
102+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
103+
with:
104+
persist-credentials: false
91105
- uses: actions/setup-python@v6
92106
with:
93107
python-version: "3.13"
@@ -101,6 +115,7 @@ jobs:
101115
name: dist
102116
path: dist
103117
publish:
118+
name: Publish to PyPI
104119
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
105120
needs:
106121
- build
@@ -109,14 +124,14 @@ jobs:
109124
name: release
110125
url: https://pypi.org/p/babel/
111126
permissions:
112-
id-token: write
127+
id-token: write # Required for Trusted Publishing action
113128
steps:
114129
- uses: actions/download-artifact@v5
115130
with:
116131
name: dist
117132
path: dist/
118133
- name: Publish package distributions to PyPI
119-
uses: pypa/gh-action-pypi-publish@release/v1
134+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
120135
with:
121136
verbose: true
122137
print-hash: true

.github/workflows/security.yml

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

0 commit comments

Comments
 (0)