Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows/actionlint: run zizmor #195961

Merged
merged 1 commit into from
Oct 30, 2024
Merged

workflows/actionlint: run zizmor #195961

merged 1 commit into from
Oct 30, 2024

Conversation

carlocab
Copy link
Member

This tool, written by a certain @woodruffw, seems like it would be useful.

See https://github.com/woodruffw/zizmor.

Needs #195936.

@carlocab carlocab requested review from MikeMcQuaid and a team as code owners October 29, 2024 16:51
@carlocab carlocab added the CI-syntax-only Change only affects brew syntax, not the install. Only run syntax CI. label Oct 29, 2024
@github-actions github-actions bot added automerge-skip `brew pr-automerge` will skip this pull request workflows PR modifies GitHub Actions workflow files labels Oct 29, 2024
@carlocab carlocab marked this pull request as draft October 29, 2024 16:53
@woodruffw
Copy link
Member

For viz: woodruffw/zizmor#57 will make the SARIF output slightly friendlier for GitHub's SARIF support once fixed. Right now the SARIF results are well-formed and uploaded correctly, but don't rebase correctly on top of the repo root.

@github-advanced-security
Copy link

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.

Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

LGTM behaviorally. I leave it up to you whether you'd prefer I fix woodruffw/zizmor#57 before merging here or not -- the results will show up as is, but won't be as easy to relate to existing files until that's fixed 🙂

This seems like it would be useful.
@carlocab
Copy link
Member Author

Dropped HOMEBREW_NO_INSTALL_FROM_API to avoid erroring out when these formulae are updated.

I leave it up to you whether you'd prefer I fix woodruffw/zizmor#57 before merging here or not -- the results will show up as is, but won't be as easy to relate to existing files until that's fixed 🙂

May also just wait until this is fixed.

@woodruffw
Copy link
Member

I've released v0.1.3, which contains the SARIF fix.

Example render:

https://github.com/woodruffw/zizmor/security/code-scanning/2

@carlocab
Copy link
Member Author

Can't see, but we can re-run actionlint / zizmor after #196022 has hit the API.

@woodruffw
Copy link
Member

Ah, whoops. Here's a cap:

(There's still lots of room for improvement there.)

@carlocab
Copy link
Member Author

Cool. Let's give this a try. There are a lot of warnings though -- many of them would be difficult to address.

@carlocab carlocab added this pull request to the merge queue Oct 30, 2024
Merged via the queue into master with commit ea5bf0d Oct 30, 2024
20 checks passed
@carlocab carlocab deleted the zizmor branch October 30, 2024 02:55
@carlocab
Copy link
Member Author

Something that would be nice to fix is that the output on GitHub isn't quite as nice as on the command-line. For example:

https://github.com/Homebrew/homebrew-core/security/code-scanning/34

Compare this with:

warning[artipacked]: credential persistence through GitHub Actions artifacts
   --> /opt/homebrew/Library/Taps/homebrew/homebrew-core/.github/workflows/tests.yml:147:9
    |
147 |       - uses: actions/checkout@v4
    |         ------------------------- does not set persist-credentials: false
    |

On GitHub you don't see the recommendation to set persist-credentials: false.

@woodruffw
Copy link
Member

Something that would be nice to fix is that the output on GitHub isn't quite as nice as on the command-line. For example:

Yep, this is tracked with woodruffw/zizmor#66. I'll try and fix that with the next release.

carlocab added a commit to Homebrew/ci-orchestrator that referenced this pull request Oct 30, 2024
carlocab added a commit to Homebrew/ci-orchestrator that referenced this pull request Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge-skip `brew pr-automerge` will skip this pull request CI-syntax-only Change only affects brew syntax, not the install. Only run syntax CI. workflows PR modifies GitHub Actions workflow files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants