Skip to content

Commit 8bfd923

Browse files
committed
implement zizmor fixes
1 parent 9a91c4e commit 8bfd923

File tree

3 files changed

+36
-14
lines changed

3 files changed

+36
-14
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Documentation
22

3+
# no permissions by default
4+
permissions: {}
5+
36
on:
47
pull_request:
58
push:
@@ -12,15 +15,18 @@ on:
1215
jobs:
1316
build-docs:
1417
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
1520

1621
steps:
1722
- name: checkout
18-
uses: actions/checkout@v5
23+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1924
with:
2025
fetch-depth: 0
26+
persist-credentials: false
2127

2228
- name: Setup Micromamba Python
23-
uses: mamba-org/setup-micromamba@v2
29+
uses: mamba-org/setup-micromamba@7f29b8b80078b1b601dfa018b0f7425c587c63bb # v2.0.6
2430
with:
2531
environment-name: TEST
2632
init-shell: bash
@@ -44,7 +50,7 @@ jobs:
4450
4551
- name: Deploy
4652
if: success() && github.event_name == 'release'
47-
uses: peaceiris/actions-gh-pages@v4
53+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
4854
with:
4955
github_token: ${{ secrets.GITHUB_TOKEN }}
5056
publish_dir: docs/build/html

.github/workflows/pypi.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,24 @@ defaults:
1414
shell: bash
1515

1616
jobs:
17-
packages:
17+
pypi-publish:
18+
name: Upload release to PyPI
1819
runs-on: ubuntu-latest
20+
environment:
21+
name: pypi
22+
url: https://pypi.org/p/python-ctd/
23+
permissions:
24+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
25+
1926
steps:
20-
- uses: actions/checkout@v5
27+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
with:
29+
# Should be enough for setuptools-scm
30+
fetch-depth: 100
31+
persist-credentials: false
2132

2233
- name: Set up Python
23-
uses: actions/setup-python@v5
34+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2435
with:
2536
python-version: "3.x"
2637

@@ -29,23 +40,23 @@ jobs:
2940

3041
- name: Install build tools
3142
run: |
32-
python -m pip install --upgrade pip build twine
43+
python -m pip install --upgrade build
3344
34-
- name: Build binary wheel
45+
- name: Build sdist and binary wheel
3546
run: python -m build --sdist --wheel . --outdir dist
3647

3748
- name: CheckFiles
3849
run: |
3950
ls dist
51+
python -m pip install --upgrade check-manifest
52+
check-manifest --verbose
4053
4154
- name: Test wheels
4255
run: |
4356
cd dist && python -m pip install *.whl
57+
python -m pip install --upgrade twine
4458
python -m twine check *
4559
4660
- name: Publish a Python distribution to PyPI
4761
if: success() && github.event_name == 'release'
48-
uses: pypa/gh-action-pypi-publish@release/v1
49-
with:
50-
user: __token__
51-
password: ${{ secrets.PYPI_PASSWORD }}
62+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

.github/workflows/tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Tests
22

3+
# no permissions by default
4+
permissions: {}
5+
36
on:
47
pull_request:
58
push:
@@ -15,10 +18,12 @@ jobs:
1518
fail-fast: false
1619

1720
steps:
18-
- uses: actions/checkout@v5
21+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
22+
with:
23+
persist-credentials: false
1924

2025
- name: Setup Micromamba Python ${{ matrix.python-version }}
21-
uses: mamba-org/setup-micromamba@v2
26+
uses: mamba-org/setup-micromamba@7f29b8b80078b1b601dfa018b0f7425c587c63bb # v2.0.6
2227
with:
2328
environment-name: TEST
2429
init-shell: bash

0 commit comments

Comments
 (0)