Skip to content

feat: run a github actions static analysis before checkup#104

Draft
zimeg wants to merge 21 commits into
mainfrom
zimeg-feat-gha-checks
Draft

feat: run a github actions static analysis before checkup#104
zimeg wants to merge 21 commits into
mainfrom
zimeg-feat-gha-checks

Conversation

@zimeg
Copy link
Copy Markdown
Member

@zimeg zimeg commented Jul 2, 2025

Summary

This PR attempts to add zizmor-action to the health checks for matching checks across projects 🤖 ✨

Requirements

@zimeg zimeg self-assigned this Jul 2, 2025
@zimeg zimeg added enhancement New feature or request semver:minor addressing/merging the change would necessitate a minor semver release github_actions Pull requests that update GitHub Actions code labels Jul 2, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 2, 2025

Codecov Report

❌ Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.66%. Comparing base (bcdb0c8) to head (09a7e08).
⚠️ Report is 46 commits behind head on main.

Files with missing lines Patch % Lines
src/get-sha.js 72.72% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #104      +/-   ##
==========================================
+ Coverage   94.57%   94.66%   +0.08%     
==========================================
  Files           6        6              
  Lines         369      375       +6     
==========================================
+ Hits          349      355       +6     
  Misses         20       20              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented Jul 2, 2025

📝 node is assumed to be on the runner's image as part of this change, which might be good to note in the README!

Copy link
Copy Markdown
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

📝 A few notes on happenings for the kind reviewers but I hope to attempt a prerelease before requesting review!

Comment thread action.yml
Comment on lines +30 to +48
using: composite
steps:
- name: Actions
uses: zizmorcore/zizmor-action@f52a838cfabf134edcbaa7c8b3677dde20045018 # v0.1.1
- name: Checkup
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
env:
INPUT_EXTENSION: ${{ inputs.extension }}
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_INCLUDE: ${{ inputs.include }}
INPUT_EXCLUDE: ${{ inputs.exclude }}
INPUT_CODECOV_TOKEN: ${{ inputs.codecov_token }}
INPUT_CODECOV_MAX_ATTEMPTS: ${{ inputs.codecov_max_attempts }}
INPUT_CODECOV_RETRY_DELAY: ${{ inputs.codecov_retry_delay }}
INPUT_CODECOV_TREAT_TIMEOUT_AS_ERROR: ${{ inputs.codecov_treat_timeout_as_error }}
with:
script: |
const script = require("./dist/index.js");
await script(context, core, github);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

📣 This is the main change of the PR! The action changes from a standalone JavaScript step to a "composite" action with multiple steps.

🎁 The actions/github-script package provides various inputs that we can use with the inputs of this action to run the JavaScript portion just as before!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👁️‍🗨️ Before merging or releasing this change, we might want to attempt a prerelease for expected findings-

Comment thread src/get-sha.js
module.exports = function getCommitSHA(core, github) {
module.exports = function getCommitSHA(context, core) {
// Get GitHub-event-relevant contextual details, like commit SHA
const ctx = github.context;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🪓 Most code updates replace the removed github.context with a provided context after changing to a composite action.

needs: unit_tests
permissions:
checks: write
security-events: write
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🔗 https://github.com/zizmorcore/zizmor-action

This is the recommended way to use zizmor-action as it provides stateful analysis and enables incremental triage.

@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented Jul 8, 2025

📝 https://github.com/slackapi/slack-health-score/actions/runs/16131533168/job/45519768704?pr=104#step:5:98

 INFO audit: zizmor: 🌈 completed ./.github/workflows/publish.yml
 INFO audit: zizmor: 🌈 completed ./.github/workflows/test.yml
 INFO audit: zizmor: 🌈 completed ./action.yml

@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented Jul 8, 2025

📝 A note on expected errors and found comments might also include a section in the README for reasoning and gotchas:

# zizmor: ignore[dangerous-triggers]

@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented Oct 28, 2025

📝 Interesting settings that might be nice to use adjacent to these checks: https://github.blog/changelog/2025-08-15-github-actions-policy-now-supports-blocking-and-sha-pinning-actions/

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

Labels

enhancement New feature or request github_actions Pull requests that update GitHub Actions code semver:minor addressing/merging the change would necessitate a minor semver release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants