Repository navigation
Authenticate semgrep container pull with caller's Docker Hub credentials - #23
Merged
Merged
Conversation
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.
Summary
The Semgrep reusable workflow's job container pulls
semgrep/semgrepfrom Docker Hub anonymously. Hosted runner IPs share Docker Hub's anonymous pull rate limit, so callers' Semgrep runs have been failing at "Initialize containers" with Docker Hub errors (seen in kernel/kernel and kernel/infra today).Add a
credentials:block to the container usingvars.DOCKERHUB_USERNAME/secrets.DOCKERHUB_TOKEN. In a reusable workflow,varsand inherited secrets resolve from the calling repository, so each caller's own Docker Hub credentials are used. Callers that passsecrets: inheritand have these configured get authenticated pulls; callers without them fall back to today's anonymous pull (the runner skips login when the values are empty).Callers using this workflow at
@main(kernel/kernel, kernel/infra, and others) pick this up on their next PR run once merged — no caller-side change needed.Testing
This PR's own CI exercises the change. Did not run anything locally (workflow-only change).
Note
Low Risk
Workflow-only change with optional credentials and no application or security-logic changes; misconfigured secrets would only affect container pull, not code execution paths.
Overview
Fixes Semgrep reusable workflow failures at container initialization caused by Docker Hub anonymous pull rate limits on shared GitHub runner IPs.
The
scanjob’ssemgrep/semgrepcontainer now includes acredentialsblock wired to the calling repo’svars.DOCKERHUB_USERNAMEandsecrets.DOCKERHUB_TOKEN(withsecrets: inherit). Repos that configure those get authenticated pulls; if they’re unset, behavior stays the same as before with an anonymous pull.Reviewed by Cursor Bugbot for commit a80699d. Bugbot is set up for automated code reviews on this repo. Configure here.