Skip to content

Add zizmor for GHA security analysis - #2201

Merged
tim-schilling merged 2 commits into
mainfrom
add-zizmor
Nov 10, 2025
Merged

Add zizmor for GHA security analysis#2201
tim-schilling merged 2 commits into
mainfrom
add-zizmor

Conversation

@tim-schilling

Copy link
Copy Markdown
Member

Code sourced from: https://docs.zizmor.sh/integrations/#github-actions

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

@github-advanced-security

Copy link
Copy Markdown

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@matthiask matthiask left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. I think it's a good idea to try this out.

@tim-schilling

Copy link
Copy Markdown
Member Author

We were discussing this in django-commons/best-practices#13 and decided on limiting it to only run based on .github/ files. What do you think about that?

- Pin all third-party actions to full-length commit SHAs instead of tags
- Add `persist-credentials: false` to all actions/checkout steps to prevent credential exposure
- Add explicit permissions declarations
- Pin mariadb Docker image to specific version (11.8) instead of using floating `latest` tag
- Replace template expressions with environment variables where possible
@tim-schilling
tim-schilling merged commit 0397b95 into main Nov 10, 2025
63 checks passed
@tim-schilling
tim-schilling deleted the add-zizmor branch November 10, 2025 15:46
run: >-
gh release create
'${{ github.ref_name }}'
'${GITHUB_REF_NAME}'

Copy link
Copy Markdown

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.)

run: >-
gh release upload
'${{ github.ref_name }}' dist/**
'${GITHUB_REF_NAME}' dist/**

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same as above!

@woodruffw

Copy link
Copy Markdown

Sorry for being nosey on this PR, but I was looking at downstream users of zizmor-action and saw two things that I figured might cause problems for you all once you do your next release.

(And thanks for trying out zizmor!)

@tim-schilling

Copy link
Copy Markdown
Member Author

Thank you for the spot check! I knew I needed to test the release, but didn't get around to it. I really need to automate that 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants