-
Notifications
You must be signed in to change notification settings - Fork 0
audit: idempotency, consistency, and hardening improvements #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
387bd1f
adc69b1
59e369b
6b39e89
cda4a81
caa67fa
ff2062e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| { | ||
| "$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
| "extends": ["config:base"], | ||
| "extends": ["config:recommended"], | ||
| "timezone": "America/Los_Angeles", | ||
| "schedule": ["every weekend"], | ||
| "prCreation": "not-pending", | ||
| "automerge": true, | ||
| "automerge": false, | ||
| "automergeType": "pr", | ||
| "automergeStrategy": "squash", | ||
| "labels": ["dependencies", "docker"], | ||
|
|
@@ -26,6 +26,12 @@ | |
| "automerge": true, | ||
| "commitMessageTopic": "go module {{depName}}" | ||
| }, | ||
| { | ||
| "matchDatasources": ["github-releases"], | ||
| "matchUpdateTypes": ["minor", "patch"], | ||
| "automerge": true, | ||
| "commitMessageTopic": "github release {{depName}}" | ||
| }, | ||
| { | ||
| "matchUpdateTypes": ["major"], | ||
| "automerge": false, | ||
|
|
@@ -46,25 +52,25 @@ | |
| }, | ||
| { | ||
| "customType": "regex", | ||
| "description": "Update cosign version and SHA in workflow", | ||
| "description": "Update cosign version in workflow (version field only; SHA256 must be updated manually or via a separate manager)", | ||
| "fileMatch": ["^\\.github/workflows/build-caddy\\.yml$"], | ||
| "matchStrings": [ | ||
| "COSIGN_VERSION: (?<currentValue>v[^\\n]+)(?:\\n\\s+#[^\\n]*)*\\n\\s+COSIGN_SHA256: \"(?<currentDigest>[a-f0-9]+)\"" | ||
| "COSIGN_VERSION: (?<currentValue>v[^\\n]+)" | ||
| ], | ||
| "datasourceTemplate": "github-releases", | ||
| "depNameTemplate": "sigstore/cosign", | ||
| "extractVersionTemplate": "^(?<version>.*)$" | ||
| "versioningTemplate": "semver" | ||
|
Comment on lines
+55
to
+62
|
||
| }, | ||
| { | ||
| "customType": "regex", | ||
| "description": "Update docker-scout version and SHA in workflow", | ||
| "description": "Update docker-scout version in workflow (version field only; SHA256 must be updated manually or via a separate manager)", | ||
| "fileMatch": ["^\\.github/workflows/build-caddy\\.yml$"], | ||
| "matchStrings": [ | ||
| "SCOUT_VERSION: (?<currentValue>v[^\\n]+)(?:\\n\\s+#[^\\n]*)*\\n\\s+SCOUT_SHA256: \"(?<currentDigest>[a-f0-9]+)\"" | ||
| "SCOUT_VERSION: (?<currentValue>v[^\\n]+)" | ||
| ], | ||
| "datasourceTemplate": "github-releases", | ||
| "depNameTemplate": "docker/scout-cli", | ||
| "extractVersionTemplate": "^(?<version>.*)$" | ||
| "versioningTemplate": "semver" | ||
|
Comment on lines
65
to
+73
|
||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,7 +46,7 @@ jobs: | |
| # STEP 1 — Checkout | ||
| # ────────────────────────────────────────────────────────── | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| ref: ${{ github.ref_name }} | ||
| fetch-depth: 0 | ||
|
|
@@ -159,15 +159,17 @@ jobs: | |
| )" | ||
|
|
||
| echo "Resolving cache-handler HEAD commit..." | ||
| # caddyserver/cache-handler uses 'master' as its default branch (not 'main'). | ||
| CACHE_HANDLER_REF="$( | ||
| retry git ls-remote --heads https://github.com/caddyserver/cache-handler.git \ | ||
| | awk '/refs\/heads\/main/ {print $1}' | ||
| | awk '/refs\/heads\/master/ {print $1}' | ||
| )" | ||
|
|
||
| echo "Resolving transform-encoder HEAD commit..." | ||
| # caddyserver/transform-encoder uses 'master' as its default branch (not 'main'). | ||
| TRANSFORM_ENCODER_REF="$( | ||
| retry git ls-remote --heads https://github.com/caddyserver/transform-encoder.git \ | ||
| | awk '/refs\/heads\/main/ {print $1}' | ||
| | awk '/refs\/heads\/master/ {print $1}' | ||
| )" | ||
|
|
||
| echo "Resolving caddy-security version..." | ||
|
|
@@ -332,7 +334,7 @@ jobs: | |
| - name: Cache CLI tools | ||
| if: steps.decide.outputs.should_build == 'true' | ||
| id: cache-cli | ||
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 | ||
| uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | ||
| with: | ||
| path: | | ||
| ~/.local/bin/cosign | ||
|
|
@@ -382,14 +384,14 @@ jobs: | |
|
|
||
| - name: Login to DockerHub | ||
| if: steps.decide.outputs.should_build == 'true' | ||
| uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 | ||
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | ||
| with: | ||
| username: ${{ env.DOCKERHUB_USERNAME }} | ||
| password: ${{ env.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Login to GHCR | ||
| if: steps.decide.outputs.should_build == 'true' | ||
| uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 | ||
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | ||
| with: | ||
| registry: ${{ env.GHCR_REGISTRY }} | ||
| username: ${{ github.actor }} | ||
|
|
@@ -401,7 +403,7 @@ jobs: | |
| - name: Build Local Test Image | ||
| if: steps.decide.outputs.should_build == 'true' | ||
| timeout-minutes: 30 | ||
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 | ||
| uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0 | ||
| with: | ||
| context: ./docker/caddy | ||
| platforms: linux/amd64 | ||
|
|
@@ -549,7 +551,7 @@ jobs: | |
| if: steps.decide.outputs.should_build == 'true' | ||
| id: push | ||
| timeout-minutes: 60 | ||
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 | ||
| uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0 | ||
| with: | ||
| context: ./docker/caddy | ||
| platforms: linux/amd64,linux/arm64 | ||
|
|
@@ -679,6 +681,10 @@ jobs: | |
|
|
||
| # ────────────────────────────────────────────────────────── | ||
| # STEP 12 — Commit and push metadata (always runs) | ||
| # Pushes to the branch that triggered this workflow run | ||
| # (github.ref_name), not a hardcoded branch name. This allows | ||
| # the workflow to be tested on feature/audit branches without | ||
| # accidentally writing metadata back to main. | ||
| # ────────────────────────────────────────────────────────── | ||
| - name: Commit and Push Metadata | ||
| if: always() | ||
|
|
@@ -700,13 +706,13 @@ jobs: | |
| # Rebase on any concurrent commits pushed while this job was running. | ||
| # The concurrency group (cancel-in-progress: true) prevents two jobs | ||
| # from running simultaneously, but a Renovate automerge or other | ||
| # automation could push to main between our checkout and this push. | ||
| git pull --rebase origin main || { | ||
| echo "ERROR: git rebase failed — likely a merge conflict with concurrent main changes." >&2 | ||
| # automation could push to the branch between our checkout and this push. | ||
| git pull --rebase origin "${{ github.ref_name }}" || { | ||
| echo "ERROR: git rebase failed — likely a merge conflict with concurrent branch changes." >&2 | ||
| git rebase --abort 2>/dev/null || true | ||
| exit 1 | ||
| } | ||
|
Comment on lines
+710
to
714
|
||
| git push origin HEAD:main | ||
| git push origin "HEAD:${{ github.ref_name }}" | ||
|
|
||
| # ────────────────────────────────────────────────────────── | ||
| # STEP 13 — Create GitHub Release | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling
automergeforgithub-releasesis risky given the changes to thecosignanddocker-scoutcustom managers (lines 53-74). Since those managers have been updated to only track the version string and explicitly require manual SHA256 updates, any automated version bump will result in a checksum mismatch in the workflow. Ifautomergeis set totrue, Renovate will attempt to merge these broken updates automatically if CI passes (or if the checksum check is not part of the CI gate). It is safer to set this tofalseto ensure a human verifies and updates the corresponding SHA256 before merging.