Repository navigation
Pull semgrep container from Google's Docker Hub mirror - #24
Merged
Merged
Conversation
The credentials block from #23 breaks callers without DOCKERHUB_USERNAME / DOCKERHUB_TOKEN: empty values in container credentials make the runner fail template validation with "Unexpected value ''", so every consumer's scan job dies before it starts. The mirror needs no credentials and sidesteps the shared anonymous Docker Hub pull rate limit that motivated #23. Add a self-test workflow that runs the scan on PRs touching semgrep.yml.
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
container.credentialsblock added in #23 breaks every caller that doesn't defineDOCKERHUB_USERNAME/DOCKERHUB_TOKEN(e.g. kernel/cli): the expression resolves to an empty string and the runner rejects the whole reusable workflow template before the job can start:This is a known runner limitation for empty values in the
containermap (actions/runner#4204). Since this workflow has ~24 consumer repos, credentials keyed on caller-side vars/secrets can't work without every repo opting in.Instead, pull the image through Google's unauthenticated Docker Hub mirror
mirror.gcr.io/semgrep/semgrep— no credentials needed, and it sidesteps the shared anonymous Docker Hub pull rate limit that motivated #23 (the same option 2 proposed in the original incident thread). Added a comment in the workflow explaining why a credentials block must not come back.Also adds
semgrep-self-test.ymlfollowing the repo's existing self-test convention: any PR touchingsemgrep.ymlruns the scan against this repo itself, so the container pull is exercised in a realpull_requestcontext before merge.Testing
This PR's own self-test run exercises the fixed container pull end to end (template validation + image pull + semgrep scan). Consumer repos are unaffected otherwise — the caller-facing interface (inputs, outputs, secrets) is unchanged.
Note
Low Risk
CI-only change to container image source; caller inputs, outputs, and secrets are unchanged.
Overview
Fixes reusable Semgrep workflow consumers that were failing template validation when
DOCKERHUB_USERNAME/DOCKERHUB_TOKENwere unset (empty credential values break thecontainermap).The scan job now uses
mirror.gcr.io/semgrep/semgrepinstead of Docker Hub with acredentialsblock, avoiding both anonymous Hub rate limits and per-repo secret requirements. Inline comments document why a credentials block must not be reintroduced.Adds
semgrep-self-test.yml, which on PRs that touch the Semgrep workflows reusessemgrep.ymlso image pull and the scan run in a realpull_requestcontext before merge.Reviewed by Cursor Bugbot for commit f7c2745. Bugbot is set up for automated code reviews on this repo. Configure here.