-
Notifications
You must be signed in to change notification settings - Fork 4
feat(zizmor): run zizmor against actions and workflows #20
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,18 +31,19 @@ jobs: | |
| steps: | ||
| - name: Generate token | ||
| id: generate-token | ||
| uses: tibdex/github-app-token@v1 | ||
| uses: tibdex/github-app-token@32691ba7c9e7063bd457bd8f2a5703138591fa58 # v1 | ||
| continue-on-error: true | ||
| with: | ||
| app_id: ${{ secrets.DEPENDABOTREVIEWER_ID }} | ||
| private_key: ${{ secrets.DEPENDABOTREVIEWER_PEM }} | ||
| - name: Dependabot metadata | ||
| id: dependabot-metadata | ||
| uses: dependabot/[email protected] | ||
| uses: dependabot/fetch-metadata@cd6e996708b8cfe0b639401134a3b9a3177be7b2 # v1.5.1 | ||
| - name: Enable auto-merge for Dependabot PRs | ||
| run: gh pr merge --auto --${{ inputs.repository-merge-method }} "$PR_URL" | ||
| run: gh pr merge --auto --${MERGE_METHOD} "$PR_URL" | ||
| env: | ||
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token || secrets.envPAT || secrets.GITHUB_TOKEN}} | ||
| MERGE_METHOD: ${{ inputs.repository-merge-method }} | ||
| - name: Approve patch updates | ||
| if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' }} | ||
| run: gh pr review $PR_URL --approve -b "**Approving** patch update" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| name: zizmor GitHub Actions static analysis | ||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| zizmor: | ||
| name: Run zizmor from current branch (self test) | ||
|
|
||
| permissions: | ||
| actions: read | ||
| contents: read | ||
|
|
||
| pull-requests: write | ||
| security-events: write | ||
|
|
||
| uses: grafana/shared-workflows/.github/workflows/reusable-zizmor.yml@8fa210559ab2cc62e7b12d3bb9cba19dbc862c11 | ||
| with: | ||
iainlane marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| runs-on: ${{ !github.event.repository.private && 'ubuntu-latest' || 'ubuntu-arm64-small' }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, this will go straight to blocking - is that the intention?
To do "informational only", it'd be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention is that it'd be a failing test, but not "required" if there's anything that's high or above (which I think is the default). So it shouldn't immediately block, and then the "required" one would block on failure once we turn that one on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok - just as a note of caution: I've rolled out changes like that before, and I'd say that the notion of a required check is not super well understood. We ended up getting quite a few questions from folks asking how they could unblock their stuff, when it never was blocked, because they'd seen the ❌.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I see, yeah, I think in this case we probably kinda want that behaviour, no technical block, but prompting folks to update their workflows with the suggestion.