Skip to content

Improve security of our GitHub Actions - #18413

Merged
sobolevn merged 16 commits into
masterfrom
add-zizmor
Jan 14, 2025
Merged

Improve security of our GitHub Actions#18413
sobolevn merged 16 commits into
masterfrom
add-zizmor

Conversation

@sobolevn

@sobolevn sobolevn commented Jan 2, 2025

Copy link
Copy Markdown
Member

Recently CPython introduced this new tool: https://github.com/python/cpython/blob/8eebe4e6d02bb4ad3f1ca6c52624186903dce893/.pre-commit-config.yaml#L64-L67

Which finds different security related problems with GitHub Actions.

I added this tool to our .pre-commit-config.yaml and followed all its recommendations.

Changes:

@sobolevn

sobolevn commented Jan 2, 2025

Copy link
Copy Markdown
Member Author

CC @hugovk

Comment thread .github/workflows/sync_typeshed.yml Outdated
@sobolevn
sobolevn requested a review from AlexWaygood January 3, 2025 08:36
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@AlexWaygood AlexWaygood 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.

Nice, this overall looks great! I'm not familiar with the workflow_call/workflow_run distinction, though, so I haven't looked closely at that. (It looks reasonable, though.)

Another change you might want to make is to list shellcheck as an additional_dependency of actionlint -- I made this change to Ruff's pre-commit config: https://github.com/astral-sh/ruff/blob/0837cdd9314cb9ee1df087142af975d492e3e7ba/.pre-commit-config.yaml#L103-L121. actionlint's shellcheck integration is very useful (it grabs the shell-script strings in GitHub Actions run: steps and passes them to shellcheck), but it's not enabled by default when actionlint is run as part of pre-commit, as actionlint's shellcheck integration only works if shellcheck is already installed.

Comment thread .github/workflows/build_wheels.yml
Comment thread .github/workflows/mypy_primer.yml Outdated
Comment thread .github/workflows/sync_typeshed.yml Outdated
Comment thread .github/workflows/docs.yml
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

Comment thread .github/workflows/mypy_primer_comment.yml
Comment thread .github/workflows/mypy_primer_comment.yml
Comment thread .github/workflows/sync_typeshed.yml
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

Comment thread .github/workflows/reusable_mypy_primer_comment.yml Outdated
@sobolevn sobolevn mentioned this pull request Jan 4, 2025
Comment thread .github/workflows/build_wheels.yml Outdated
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jan 8, 2025

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@sobolevn

Copy link
Copy Markdown
Member Author

Going to do the last ping for reviews :)
Planning to merge this in a couple of days.

@AlexWaygood AlexWaygood 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.

LGTM

@sobolevn
sobolevn merged commit a6c1184 into master Jan 14, 2025
@sobolevn
sobolevn deleted the add-zizmor branch January 14, 2025 12:21
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.

5 participants