Skip to content

ci: rescan the binaries once a release has published - #147

Merged
katbyte merged 1 commit into
mainfrom
kt/binary-scan-after-release
Sep 22, 2026
Merged

katbyte merged 1 commit into
mainfrom
kt/binary-scan-after-release

Conversation

@katbyte

@katbyte katbyte commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Rerun the binary scan as soon as a release finishes publishing.

Why: the scan added in #146 only runs on a push to main and on Mondays. Ship the fixed release and the red on main stays until one of those happens, so the signal is wrong for up to a week right after you did the thing it asked for.

The release workflow finishing now triggers a rescan. Gated on the release having succeeded, so a failed release does not scan and wrongly clear anything.

   schedule:
     - cron: '23 5 * * 1'
+  workflow_run:  # zizmor: ignore[dangerous-triggers]
+    workflows: ['Release']
+    types: ['completed']
   workflow_dispatch:
   release:
     name: release binary
     runs-on: ubuntu-latest
+    if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'

The zizmor suppression. workflow_run is flagged because it can hand repository secrets to a run kicked off by untrusted code, the usual case being a fork PR's workflow. Here it only reacts to the tag-triggered Release workflow, checks out main, and the workflow has read-only permissions, so there is nothing to leak. The reason is in a comment next to the suppression.

Things that are fine as they are. Listening for the release rather than having the release workflow dispatch the scan means release.yaml keeps its current permissions and gains no actions: write. The scan itself is unchanged, and the first run on main after #146 was red on both jobs for x/text 0.37.0, which is the expected result until it is bumped and released.

Without this the red from a vulnerable release only clears on the next push
to main or the Monday cron, not when the fixed release ships. workflow_run
on the Release workflow reruns both jobs against main as soon as the assets
exist, gated on the release having succeeded.
@katbyte
katbyte merged commit a99b817 into main Sep 22, 2026
11 checks passed
katbyte added a commit that referenced this pull request Sep 22, 2026
… a new one (#149)

The workflow_run rescan from #147 attached to the same commit but as its own
check runs, so the original push failure stayed and the commit kept its red
X. Only a rerun replaces a check run in place. The release workflow now
reruns the failed jobs of any binary scan on main's head, which needs
actions: write on that one job.
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.

1 participant