KEMBAR78
Improve security of our GitHub Actions by sobolevn · Pull Request #18413 · python/mypy · GitHub
Skip to content

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Jan 2, 2025

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
Copy link
Member Author

sobolevn commented Jan 2, 2025

CC @hugovk

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

Copy link
Member

@AlexWaygood AlexWaygood left a comment

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.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@sobolevn sobolevn mentioned this pull request Jan 4, 2025
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2025

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

@sobolevn
Copy link
Member Author

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

Copy link
Member

@AlexWaygood AlexWaygood left a comment

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
18 checks passed
@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