Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a GitHub Actions workflow to automatically keep the CLOUDFLARED_VERSION variable in docker-bake.hcl up to date. The workflow runs on a schedule (every 6 hours) and can also be triggered manually; it fetches the latest release tag from cloudflare/cloudflared and opens an automated PR if a newer version is found.
Changes:
- Adds a new scheduled GitHub Actions workflow that checks for the latest
cloudflare/cloudflaredrelease - Parses and updates the
CLOUDFLARED_VERSIONdefault value indocker-bake.hclusingawk - Opens a PR via
peter-evans/create-pull-requestif the version has changed
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
I manually test every new version before I merge it to main, there have been several new versions which justified this practice because of various changes they made upstream with no regard for my image |
|
That testing could probably be automated nowadays though, I just don't feel like doing it myself. I build the image with |
I see, then keep with the PR approach |
Checks for new cloudflared releases every 6 hours and opens a pull request bumping CLOUDFLARED_VERSION, plus GOVERSION when the release needs a newer Go. Every platform is tested by running a hello world quick tunnel and requesting it, and updates that pass are merged after 24 hours unless someone objects.
Follow-up to the discussion in this PR. It automates the manual test (bake, run with
--hello-world, request the tunnel URL several times) on every architecture, and merges new versions automatically once they pass and nobody has objected for 24 hours.docker-build.ymlworkflow_dispatchtrigger, as suggested here.smoke-testjob for all 8 platforms. It runs on every push and PR, next to the existing multi-arch build. Each job:cloudflared versionmatchesCLOUDFLARED_VERSION,--hello-world,linux/amd64,linux/386ubuntu-latest, nativelylinux/arm64ubuntu-24.04-arm, nativelylinux/arm/v7linux/arm/v6linux/s390x,linux/ppc64le,linux/riscv64The v6 job emulates the actual Pi 1 CPU, so a regression of the
GOARM=6fix gets caught. I checked this: the v7 binary crashes withIllegal instructionon that CPU, and the v6 binary runs.update-cloudflared.ymlRuns every 6 hours, or manually, optionally for a specific version.
Merges a tested update. It merges the open update PR when all of these hold:
holdlabel.It squash-merges, then runs
docker-buildonmainto publish. A merge made withGITHUB_TOKENdoesn't trigger the push build, so this step is needed. If the build fails, it re-runs the failed jobs once, because quick tunnels are best effort. If they fail again, it comments once on the PR and mentions the repo owner.Opens or updates the PR.
CLOUDFLARED_VERSIONto the latest upstream release.GOVERSIONto the newestgolang:X.Y.Z-alpine$ALPINEVERSIONimage on Docker Hub, for the Go minor that the release'sgo.modrequires. It never downgrades. It keeps the Dockerfile'sARG GOVERSIONdefault on the same minor.GOTOOLCHAIN=local, so bumping only the cloudflared version would fail to build.update-cloudflaredPR, then runsdocker-buildon it withgh workflow run.To stop an update:
holdlabel to wait. Create the label the first time you use it.Worth knowing
pull_requestrun waiting for approval. It can be ignored, because the dispatched run is the one that counts.main, becauseworkflow_dispatchis read from the default branch.ALPINEVERSIONis still bumped by hand. If a release needs a Go minor that has no image for the pinned Alpine, the updater fails and says so.Tested on GitHub's runners (in my fork)
Upgrade cloudflared to 2026.10.2, Go to 1.27.3.mainbuild was started.Illegal instruction. So the CPU setting reaches QEMU on the runners, and the v6 check would catch a regression.Tested locally
main: 2026.8.2 → 2026.10.2, Go 1.26.6 → 1.27.3, Dockerfile default 1.26 → 1.27. A second run made no changes.docker buildx bake(golang:1.27.3-alpine3.24) and the smoke test passed.gh:hold, no build, build running, failed (comments only once), passed but under 24h, passed and merged.