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 }}
5668 PIP_DISABLE_PIP_VERSION_CHECK : " 1"
5769 steps :
5870 - uses : actions/checkout@v5
71+ with :
72+ persist-credentials : false
5973 - uses : actions/cache@v4
6074 with :
6175 path : cldr
@@ -76,19 +90,22 @@ jobs:
7690 env :
7791 COVERAGE_XML_PATH : ${{ runner.temp }}
7892 BABEL_TOX_EXTRA_DEPS : pytest-github-actions-annotate-failures
79- - uses : codecov/codecov-action@v5
93+ - uses : codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
8094 with :
8195 directory : ${{ runner.temp }}
8296 flags : ${{ matrix.os }}-${{ matrix.python-version }}
8397 token : ${{ secrets.CODECOV_TOKEN }}
8498 verbose : true
8599 build :
100+ name : build
86101 permissions :
87102 contents : read
88103 runs-on : ubuntu-24.04
89104 needs : lint
90105 steps :
91106 - uses : actions/checkout@v5
107+ with :
108+ persist-credentials : false
92109 - uses : actions/setup-python@v6
93110 with :
94111 python-version : " 3.14"
@@ -102,6 +119,7 @@ jobs:
102119 name : dist
103120 path : dist
104121 publish :
122+ name : publish
105123 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
106124 needs :
107125 - build
@@ -110,14 +128,14 @@ jobs:
110128 name : release
111129 url : https://pypi.org/p/babel/
112130 permissions :
113- id-token : write
131+ id-token : write # Required for Trusted Publishing action
114132 steps :
115133 - uses : actions/download-artifact@v5
116134 with :
117135 name : dist
118136 path : dist/
119137 - name : Publish package distributions to PyPI
120- uses : pypa/gh-action-pypi-publish@release/v1
138+ uses : pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
121139 with :
122140 verbose : true
123141 print-hash : true
0 commit comments