ci: migrate to netresearch/.github reusable container workflows#123
Merged
Conversation
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
Extract the Dockerfile-lint and bake-graph-validate steps from build.yml's inline `lint` job into a new top-level workflow .github/workflows/lint.yml. The hadolint piece now delegates to netresearch/.github's reusable `lint-container.yml@main`, which pins hadolint to v2.14.0 (handles Docker 25's HEALTHCHECK --start-interval that crashes hadolint-action's bundled v2.12.0). The `docker buildx bake --print` graph validation stays inline in the new lint.yml because the reusable model is single-target build-push-action, not bake. build.yml's `build` job stays inline — its bake multi-target shape (minimal + full variants from docker-bake.hcl) doesn't map onto the build-container reusable's single-target shape, flagged as upstream follow-up. No shell-scandirs passed: phpbu-docker does not ship its own shell helper directories — docker-entrypoint.sh lives in the build context and is exercised via the structure tests, not separately shellchecked. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Replace inline OpenSSF Scorecard workflow with a caller stub that delegates to netresearch/.github's reusable `scorecard.yml@main`. The reusable already runs harden-runner, pins all third-party action SHAs, sets persist-credentials: false, and uploads SARIF (skipping on merge_group where the gh-readonly-queue ref races with the upload). Caller passes the full permissions set the reusable's job requires (security-events: write, id-token: write, contents: read, actions: read) plus the workflow-level `contents: read` minimum that SonarCloud rule githubactions:S8234 expects. Schedule slot kept at Monday 06:00 UTC to match the build.yml weekly security rebuild cadence; workflow_dispatch added for on-demand runs. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
…eusable Replace the inline structure-test job (bake build + curl-installed CST binary + run) with a caller stub that delegates to netresearch/.github's reusable smoke-test-container.yml@main. The reusable builds via docker/build-push-action with explicit target/image-tag inputs — equivalent to the bake `ci` target which is just `target = "minimal"` with a local phpbu:ci tag. Reusable benefits: harden-runner egress audit, SHA256-pinned CST v1.22.1, persist-credentials: false, cache-scope isolation, single source of truth for the CST install procedure across all Netresearch container repos. The phpbu-specific smoke-test matrix job (matrix over ci/ci-full covering TZ env-var injection sanitisation, read-only filesystem compatibility, simulate-mode with a fixture config, full-variant extras) stays inline — those tests target the entrypoint contract and runtime shape of phpbu itself, which is outside the reusable's structure-test scope. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Replace the inline gitleaks job with a caller stub that delegates to netresearch/.github's reusable gitleaks.yml@main. The reusable runs betterleaks (gitleaks fork, OSS, no license needed — the deprecated GITLEAKS_LICENSE secret is no longer required), uploads SARIF to GitHub code-scanning, and bakes in the dependabot[bot] + merge_group skip semantics that previously lived in the caller's `if:`. The trivy job above stays inline. Its current shape is local-build-via- bake then scan, which doesn't fit security-container.yml's already-published-image model. Migrating it requires the build.yml bake-to-build-container refactor to land first; flagged as upstream follow-up. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
d206acb to
0b06212
Compare
|
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
5 tasks
CybotTM
added a commit
that referenced
this pull request
May 22, 2026
The renovate.json's "Group GitHub Actions" rule had `pinDigests: true` applied to ALL github-actions managers, which included `uses: netresearch/.github/.github/workflows/*@main` refs. Renovate faithfully turned `@main` into `@<sha>` four times (commits 9fa7178, 4f38a92, aeb49e5, 309fca0) — each a violation of the org policy that first-party Netresearch reusable workflows must use `@main` (or `@vN` once tagged releases exist), never SHA-pinned. Two changes here: 1. .github/workflows/auto-merge.yml: revert the `uses: netresearch/.github@22155f1...` back to `@main`. This is the same reusable; same behaviour. 2. renovate.json: add a packageRule that disables Renovate entirely for github-actions deps matching `^netresearch/`. The `enabled: false` setting means Renovate ignores them — no digest pins, no PRs, no further drift. The earlier wide "Group GitHub Actions" rule still pins third-party SHAs as before (per supply-chain policy). Memory: feedback_no_sha_pin_own_reusables — third-party actions (actions/checkout, docker/build-push-action) DO get SHA-pinned; first-party reusables don't. Different trust models. Discovered while migrating phpbu-docker to the reusable container workflows (PR #123). Sub-agent flagged this as an independent observation rather than bundling it into the migration PR. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
CybotTM
added a commit
that referenced
this pull request
May 22, 2026
The renovate.json's "Group GitHub Actions" rule had `pinDigests: true` applied to ALL github-actions managers, which included `uses: netresearch/.github/.github/workflows/*@main` refs. Renovate faithfully turned `@main` into `@<sha>` four times (commits 9fa7178, 4f38a92, aeb49e5, 309fca0) — each a violation of the org policy that first-party Netresearch reusable workflows must use `@main` (or `@vN` once tagged releases exist), never SHA-pinned. Two changes here: 1. .github/workflows/auto-merge.yml: revert the `uses: netresearch/.github@22155f1...` back to `@main`. This is the same reusable; same behaviour. 2. renovate.json: add a packageRule that disables Renovate entirely for github-actions deps matching `^netresearch/`. The `enabled: false` setting means Renovate ignores them — no digest pins, no PRs, no further drift. The earlier wide "Group GitHub Actions" rule still pins third-party SHAs as before (per supply-chain policy). Memory: feedback_no_sha_pin_own_reusables — third-party actions (actions/checkout, docker/build-push-action) DO get SHA-pinned; first-party reusables don't. Different trust models. Discovered while migrating phpbu-docker to the reusable container workflows (PR #123). Sub-agent flagged this as an independent observation rather than bundling it into the migration PR. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
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
Phase 4 of the container-CI consolidation across Netresearch container repos. Delegates 4 of phpbu-docker's CI workflows to the reusables in netresearch/.github that snipe-it-docker-compose-stack has been battle-testing in Phases 1-3. The build job and the trivy CVE job stay inline behind a structural blocker (docker buildx bake multi-target shape — flagged below).
What migrated
Net total bytes: +41 lines on disk but 9 fewer third-party-action SHA pins to maintain (30 → 21) — the reusables own that supply-chain surface centrally.
What stays inline, and why
Upstream follow-ups (do NOT block this PR)
githubactions:S7637("use SHA hash for actions") — the new caller stubs pin netresearch/.github to @main (hard constraint ci: bump actions/checkout from 4 to 6 #3, mandated by the user, memory ref feedback_no_sha_pin_own_reusables). Same rule-deactivation already done at project-Quality-Profile level for snipe-it; phpbu-docker likely needs the same treatment if it's SC-scanned. Cosmetic — does not affect runtime.netresearch/.githubby SHA digest in.github/workflows/auto-merge.yml, which violates the org no-SHA-pin-for-netresearch/*policy. Likely needs arenovate.jsonpackageRulesexclusion fornetresearch/.github. Tracking separately — not part of this PR (rule: do not touch auto-merge.yml).Hard-constraint compliance checklist
netresearch/.githubreusable refs use@main, never@<sha>(verified:grep -nE "netresearch/\.github" .github/workflows/*.yml).Gflag fromgit log --format='%G?') andSigned-off-by:matchesgit config user.email.secrets: inheritanywhere in the migrated files.tail -c 2 | xxd -p→*0a, never0a0a).git add.Test plan
pull_requestevent).phpbu:ci(minimal stage).