Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Post coverage comment

on:
workflow_run:
workflow_run: # zizmor: ignore[dangerous-triggers] - This follows GitHub's recommended pattern for posting PR comments from untrusted forks
workflows: ["Test"]
types:
- completed
Expand All @@ -27,7 +27,7 @@ jobs:
# DO NOT run actions/checkout here, for security reasons
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
- name: Post comment
uses: py-cov-action/python-coverage-comment-action@v3
uses: py-cov-action/python-coverage-comment-action@6494290850a5098c2836298dad8f11082b4ceaa9 # v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
14 changes: 9 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI

on: push

permissions: {}

env:
PYPI_URL: https://pypi.org/p/django-debug-toolbar
PYPI_TEST_URL: https://test.pypi.org/p/django-debug-toolbar
Expand All @@ -14,6 +16,8 @@ jobs:

steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
Expand Down Expand Up @@ -48,7 +52,7 @@ jobs:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.13
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1.13

github-release:
name: >-
Expand All @@ -69,7 +73,7 @@ jobs:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
uses: sigstore/gh-action-sigstore-python@f832326173235dcb00dd5d92cd3f353de3188e6c # v3.1.0
with:
inputs: >-
./dist/*.tar.gz
Expand All @@ -79,7 +83,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
'${GITHUB_REF_NAME}'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI, I think this will cause a failure in your release process -- it's still single quoted so the shell variable won't be expanded correctly 🙂

(i.e. it needs to be double-quoted instead.)

--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
Expand All @@ -90,7 +94,7 @@ jobs:
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
'${GITHUB_REF_NAME}' dist/**

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above!

--repo '${{ github.repository }}'

publish-to-testpypi:
Expand All @@ -114,7 +118,7 @@ jobs:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1.13
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1.13
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
13 changes: 12 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
# Run weekly on Saturday
- cron: '37 3 * * SAT'

permissions:
contents: read

jobs:
mysql:
runs-on: ubuntu-latest
Expand All @@ -18,7 +21,7 @@ jobs:

services:
mariadb:
image: mariadb
image: mariadb:11.8
env:
MARIADB_ROOT_PASSWORD: debug_toolbar
options: >-
Expand All @@ -31,6 +34,8 @@ jobs:

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
Expand Down Expand Up @@ -118,6 +123,8 @@ jobs:

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
Expand Down Expand Up @@ -167,6 +174,8 @@ jobs:

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
Expand Down Expand Up @@ -206,6 +215,8 @@ jobs:

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: GitHub Actions Security Analysis with zizmor 🌈

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]

permissions: {}

jobs:
zizmor:
name: Run zizmor 🌈
runs-on: ubuntu-latest
permissions:
security-events: write
contents: read # only needed for private repos
actions: read # only needed for private repos
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Run zizmor 🌈
uses: zizmorcore/zizmor-action@e673c3917a1aef3c65c972347ed84ccd013ecda4 # v0.2.0