11name : CI
22
3- on :
3+ # Since this same workflow file is used for both PRs and pushes,
4+ # Zizmor wants to flag all uses of caches as potential cache poisoning vulnerabilities.
5+ # I don't see a way to easily split this workflow into two separate files since
6+ # we do want to build the package for PRs, and then publish it from that exact
7+ # built artifact, if we're pushing to tags.
8+
9+ on : # zizmor: ignore[cache-poisoning]
410 push :
511 branches :
612 - master
1218 - master
1319 - ' *-maint'
1420
21+ permissions : {}
22+
1523jobs :
1624 lint :
25+ name : lint
1726 permissions :
1827 contents : read
1928 runs-on : ubuntu-latest
2029 steps :
2130 - uses : actions/checkout@v5
22- - uses : astral-sh/setup-uv@v6
31+ with :
32+ persist-credentials : false
33+ - uses : astral-sh/setup-uv@eb1897b8dc4b5d5bfe39a428a8f2304605e0983c # v7.0.0
2334 with :
2435 cache-dependency-glob : " .github/workflows/*.yml"
2536 cache-suffix : pre-commit-uv
3243 env :
3344 RUFF_OUTPUT_FORMAT : github
3445 test :
46+ name : test
3547 permissions :
3648 contents : read
3749 runs-on : ${{ matrix.os }}
5567 PIP_DISABLE_PIP_VERSION_CHECK : " 1"
5668 steps :
5769 - uses : actions/checkout@v5
70+ with :
71+ persist-credentials : false
5872 - uses : actions/cache@v4
5973 with :
6074 path : cldr
@@ -75,19 +89,22 @@ jobs:
7589 env :
7690 COVERAGE_XML_PATH : ${{ runner.temp }}
7791 BABEL_TOX_EXTRA_DEPS : pytest-github-actions-annotate-failures
78- - uses : codecov/codecov-action@v5
92+ - uses : codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
7993 with :
8094 directory : ${{ runner.temp }}
8195 flags : ${{ matrix.os }}-${{ matrix.python-version }}
8296 token : ${{ secrets.CODECOV_TOKEN }}
8397 verbose : true
8498 build :
99+ name : build
85100 permissions :
86101 contents : read
87102 runs-on : ubuntu-24.04
88103 needs : lint
89104 steps :
90105 - uses : actions/checkout@v5
106+ with :
107+ persist-credentials : false
91108 - uses : actions/setup-python@v6
92109 with :
93110 python-version : " 3.13"
@@ -101,6 +118,7 @@ jobs:
101118 name : dist
102119 path : dist
103120 publish :
121+ name : publish
104122 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
105123 needs :
106124 - build
@@ -109,14 +127,14 @@ jobs:
109127 name : release
110128 url : https://pypi.org/p/babel/
111129 permissions :
112- id-token : write
130+ id-token : write # Required for Trusted Publishing action
113131 steps :
114132 - uses : actions/download-artifact@v5
115133 with :
116134 name : dist
117135 path : dist/
118136 - name : Publish package distributions to PyPI
119- uses : pypa/gh-action-pypi-publish@release/v1
137+ uses : pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
120138 with :
121139 verbose : true
122140 print-hash : true
0 commit comments