Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches: [main]
pull_request:

# Least privilege: jobs only read the repo.
permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -16,6 +20,8 @@ jobs:
- "3.13"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
Expand Down
10 changes: 10 additions & 0 deletions template/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
workflow_call:

# Least privilege: jobs only read the repo.
permissions:
contents: read

jobs:
lint:
strategy:
Expand All @@ -18,6 +22,8 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
Expand All @@ -44,6 +50,8 @@ jobs:
- "3.13"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
Expand All @@ -58,6 +66,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
Expand Down
3 changes: 2 additions & 1 deletion template/.github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ jobs:
- name: Download release artifacts
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release download "${{ github.event.release.tag_name }}" --dir dist --repo "${{ github.repository }}"
TAG: ${{ github.event.release.tag_name }}
run: gh release download "$TAG" --dir dist --repo "$GITHUB_REPOSITORY"
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
4 changes: 4 additions & 0 deletions template/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
type: string
default: "rc"

# Least privilege: read-only by default; the release job widens its own token.
permissions:
contents: read

jobs:
ci:
uses: ./.github/workflows/ci.yaml
Expand Down
Loading