Skip to content

Commit

Permalink
harden workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Nov 30, 2024
1 parent b3a22a1 commit 086fde3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:

steps:
- uses: "actions/checkout@v4"
with:
persist-credentials: false

- uses: "pdm-project/setup-pdm@v4"
with:
Expand Down Expand Up @@ -48,6 +50,8 @@ jobs:

steps:
- uses: "actions/checkout@v4"
with:
persist-credentials: false

- uses: "actions/setup-python@v5"
with:
Expand Down Expand Up @@ -104,6 +108,8 @@ jobs:

steps:
- uses: "actions/checkout@v4"
with:
persist-credentials: false
- uses: "pdm-project/setup-pdm@v4"
with:
python-version: "3.12"
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/pypi-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ on:
- published
workflow_dispatch:

permissions:
contents: read
id-token: write

jobs:
build-package:
name: Build & verify package
Expand All @@ -23,6 +19,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- uses: hynek/build-and-inspect-python-package@v1

Expand All @@ -33,6 +30,8 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build-package
permissions:
id-token: write

steps:
- name: Download packages built by build-and-inspect-python-package
Expand All @@ -53,6 +52,8 @@ jobs:
if: github.event.action == 'published'
runs-on: ubuntu-latest
needs: build-package
permissions:
id-token: write

steps:
- name: Download packages built by build-and-inspect-python-package
Expand Down

0 comments on commit 086fde3

Please sign in to comment.