Repository navigation
[TASK] Start the build when the official PHP images get a new PHP release - #640
Conversation
…ease The nightly build picks up a PHP security release only up to a day later. php-upstream.yaml compares PHP_VERSION of the official base images with webdevops/php-official and webdevops/php-nginx every hour and starts build.yaml on master when one of ours is behind, unless a build is running or one was started in the last 8 hours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bi2Ta2LNVtJh8Cakewj8rJ
- Log in with skopeo instead of docker/login-action, so no third-party action receives the Docker Hub token (SonarCloud githubactions:S7637). - skopeo inspect --no-tags: do not list every tag of each repository. - Ignore pull_request runs when looking for a running build of master; --branch matches the head branch, which is master for many fork PRs. - A tag of ours that does not exist yet starts the build; any other read error skips the image with a warning instead of starting a full build. - Only builds this workflow started (actor github-actions[bot]) block the next one for 8 hours; builds started by hand no longer do.
|
Review follow-up, pushed as 1666bd7 (
Verification: I extracted the step scripts from the YAML and checked them with Not covered by these tests: the real Docker Hub calls and the actor of a dispatched run. Run the workflow with Generated by Claude Code |
The cooldown blocked the next build for 8 hours after any build this workflow started, also after a successful one. The official images update their versions and variants at different times, so a tag that was updated after the first build waited up to 8 hours. Now only a build that did not succeed blocks the next one. As a safety net, the workflow starts at most 3 builds within 8 hours, in case a build succeeds and still leaves an image outdated.
|



The nightly build (00:00 UTC, in practice often started hours later) picks up a PHP security release up to a day after the official
phpimages have it. This adds.github/workflows/php-upstream.yaml, which closes that gap:17 * * * *) it readsPHP_VERSION(linux/amd64) of the image in theFROMline of eachdocker/php-official/<tag>/Dockerfile, and ofwebdevops/php-official:<tag>andwebdevops/php-nginx:<tag>. It usesskopeo inspect --no-tagsafterskopeo loginto Docker Hub with the existing secrets; no third-party action gets the token.build.yamlonmasterwithgh workflow run(the token of the run withactions: write). An image that cannot be read for any other reason (rate limit, network) is skipped with a warning, so it does not start a build.masteris running or queued. Pull request runs do not count, even from a fork'smasterbranch.github-actions[bot]) did not succeed, so a failing build is not restarted every hour. It also starts at most 3 builds in that time, in case a build succeeds and still leaves an image outdated. A successful build does not block the next one: the official images update their versions and variants at different times. Builds started by hand do not count. The nightly build is unaffected.workflow_dispatchwithdry-runonly reports which tags are behind.ci/console generateonly writesbuild.yaml, so "Validate Automation" is unaffected.A build started this way is a
workflow_dispatchrun, so it uses the build cache (no-cacheis only set forschedule). The changed digest of the official base image invalidates every layer above it, so PHP is still the new one.Documentation:
docs/README.md(Platforms and updates) andCONTRIBUTING.md(Building in CI) describe the workflow.Verification:
actionlintpassed on the first version; it has not been run again since the review changes.bash -n.skopeostub: up to date, outdated, missing tag of ours (manifest unknown), read error of ours, read error of the official image, official image withoutPHP_VERSION. Each case produced the expected messages andoutdatedoutput.ghstub that evaluates the--jqexpressions withjq. Each scenario produced the expected result:github-actions[bot]. Run the workflow withdry-runafter merging to see both.