Repository navigation
Conversation
…run rerun build-linux was skipped on Dependabot pull_request runs because it logs in to Docker Hub with secrets those runs do not get. A skipped required check counts as passing. The workflow_run rerun meant to cover it checked out the default branch, not the PR, so the Linux build and Docker snapshot never ran against a dependency bump before merge. It also ran test against main for every PR, because "Dependabot PR Check" completes even when its job skips. A --snapshot build never pushes images, so the Docker Hub login only authenticates the pull of the public alpine base image. Log in when the credentials exist and pull anonymously when they do not, and run build-linux on every pull_request. Remove the workflow_run trigger and the "Dependabot PR Check" workflow, which existed only to drive it. No run now checks out PR code in a privileged context, so neither a Dependabot PR nor a fork PR is built with secrets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Run
build-linuxon every pull request, including Dependabot and fork PRs, without needing secrets. Remove theworkflow_runrerun oftestand the "Dependabot PR Check" workflow that only existed to trigger it.Why
build-linuxwas skipped on Dependabot PRs. Its job-levelifskipped it fordependabot[bot]onpull_request, because it logs in to Docker Hub with secrets that Dependabot runs do not get.build-linuxis a required check, and a skipped check counts as passing. Example: run 38388625127 (chore(deps): Bump golang.org/x/sys from 0.48.0 to 0.49.0):unit-test,build-macandbuild-windowsran,build-linuxwas skipped.workflow_runrun that was meant to cover it usedactions/checkout@v4with noref, so it checked out the default branch's head. Everyworkflow_runrun oftestis onmain(c117a4d, earlierdb4958c). Seegh run list --workflow=test --event workflow_run. The Linux build and the GoReleaser Docker snapshot never ran against a dependency bump before it merged.testrun againstmain. "Dependabot PR Check" runs on everypull_requestand completes even when its job is skipped, soworkflow_runfired for every PR. The result attaches tomain's commit, not the PR. Example: run 39615377466, triggered by the Go 1.26.10 PR, showedmainred.Change
build-linuxno longer has a job-levelif. It runs on everypull_request,pushtomainandworkflow_dispatch, like the other three build jobs.docker loginis conditional. A step checks whetherDOCKER_USERNAMEis set and writes a step output.Docker Loginruns only when it is. A step-levelifcannot readsecretsdirectly, hence the extra step. When credentials are absent the job logs a::notice::and continues.workflow_runtrigger fromtest.yml..github/workflows/dependabot_pr.yml. Nothing else referenced it, andcheck-dependabotis not a required check in branch protection or theMainruleset.Why login is not needed for this build:
goreleaser release --snapshot --skip=publishnever pushes images. The currentbuild-linuxlog (run 40877482324) sayssnapshot build: will not push any images. The only Docker Hub traffic is pulling the publicalpinebase image inDockerfile, which anonymous pulls can do.The required check names (
unit-test,build-linux,build-mac,build-windows) are unchanged.release.yml,acceptance.ymlandtest-acceptance.ymlare untouched.release.ymlstill logs in, because it pushes.Security considerations
workflow_runand check outgithub.event.workflow_run.head_sha.workflow_runruns in the base repository's context, with its secrets and its defaultGITHUB_TOKENpermissions. Building PR code there is the classic "pwn request":goreleaserrunsgo generate ./...andgo mod downloadasbeforehooks, so a maliciousgo.mod, generator or dependency would run withDOCKER_PASSWORDandGORELEASER_GITHUB_TOKENin reach. This PR avoids that rather than gating it.workflow_runrun oftestwith secrets. Open examples: fix(listen): join the forwarding URL path and the event path with a single slash #478 (fix(listen): join the forwarding URL path and the event path with a single slash) and fix(cmd): reject unsupported --output values #481 (fix(cmd): reject unsupported --output values). Before this PR that run checked outmain, so it wasted a run but did not build fork code. Anyhead_shacheckout would have needed two gates: the triggering actor isdependabot[bot]andgithub.event.workflow_run.head_repository.full_name == github.repository. After this PR there is noworkflow_runpath at all. Fork code runs only inpull_requestruns, which GitHub gives no secrets and a read-only token.pull_requestrun: no Actions secrets, read-onlyGITHUB_TOKEN.GORELEASER_GITHUB_TOKENresolves to empty there. A snapshot build does not need it:build-macandbuild-windowsalready pass under that condition (run 38388625127).mainstill log in to Docker Hub before running GoReleaser, as they did before. Those authors already have write access.build-linuxruns start failing withtoomanyrequests, the fix is a pull-through mirror or a read-only Docker Hub token in Dependabot secrets, not reintroducingworkflow_run.Testing
actionlint .github/workflows/test.yml: clean. A full-repositoryactionlintreports only pre-existing findings in files this PR does not touch (acceptance.yml,outpost-live.yml,release.yml,test-npm-install.yml).build-linuxruns here with credentials (same-repository branch), so it exercises the login branch, not the anonymous one..github/workflows/**is in its path filter.Unverified
build-linuxhas not run in CI. It will first run on the next Dependabot PR, or on an approved fork PR. Expected behaviour:testruns once onpull_request, andbuild-linuxruns instead of being skipped.Check for Docker Hub credentialslogs the notice,Docker Loginis skipped, the base image is pulled anonymously, and the snapshot builds against the PR's merge commit. Noworkflow_runrun oftestfollows.alpinesucceeding on hosted runners is based on the GoReleaser log, which shows images are only built, and on GitHub's documented exemption. It has not been observed for this job.🤖 Generated with Claude Code