diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml index 7bcc318..e74c787 100644 --- a/.github/actionlint.yaml +++ b/.github/actionlint.yaml @@ -1,5 +1,5 @@ paths: - .github/workflows/release.yml: + .github/workflows/release-publish-image.yml: # actionlint v1.7.12 and its current main parser predate GitHub's official # May 2026 concurrency.queue syntax. Test-ReleasePins.ps1 independently # requires the exact `queue: max` value; no other diagnostic is suppressed. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 519a1e4..6053423 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,7 @@ updates: time: '05:20' timezone: America/New_York cooldown: - default-days: 7 + default-days: 3 open-pull-requests-limit: 5 commit-message: prefix: build @@ -31,7 +31,7 @@ updates: time: '05:30' timezone: America/New_York cooldown: - default-days: 7 + default-days: 3 open-pull-requests-limit: 5 commit-message: prefix: build @@ -48,22 +48,25 @@ updates: time: '05:40' timezone: America/New_York cooldown: - default-days: 7 + default-days: 3 open-pull-requests-limit: 5 commit-message: prefix: build + # Temporary: pauses every melodic-software/ci-workflows bump while the GitHub + # Actions conventions migration moves these pins by hand across the org. + # Remove it in the migration's close-out sweep, once every repo is migrated. ignore: - # The runner-policy allowlist pins ci-workflows reusable-workflow refs to - # independently reviewed SHAs, so a Dependabot bump to an unreviewed main - # commit can only fail the Runner policy lane. Those pins move through - # deliberate reviewed PRs after a standards allowlist update. Composite - # actions (melodic-software/ci-workflows/.github/actions/*) are not - # SHA-allowlisted and stay Dependabot-managed. - # Pattern source: melodic-software/standards PR #102. - - dependency-name: "melodic-software/ci-workflows/.github/workflows/*" - # The GitHub Actions conventions rename migrates this repo's ci-workflows pins deliberately. Until then this also pauses composite-action bumps, overriding the policy above; remove this ignore at that migration. - dependency-name: "melodic-software/ci-workflows/*" + # The `vendor-actions` group (non-major only) is the auto-merge lane armed + # by pr-automerge-dependabot.yml; a dependency joins the first group that + # matches it, so majors fall through to the reviewed `github-actions` group. groups: + vendor-actions: + patterns: + - actions/* + - github/* + - anthropics/* + update-types: [minor, patch] github-actions: patterns: - '*' diff --git a/.github/scripts/verify-existing-release.sh b/.github/scripts/verify-existing-release.sh index 8474ada..d0a4bb8 100755 --- a/.github/scripts/verify-existing-release.sh +++ b/.github/scripts/verify-existing-release.sh @@ -99,7 +99,7 @@ version_symbol='github.com/melodic-software/ci-runner/internal/buildinfo.Version go run -trimpath -ldflags="-X ${version_symbol}=${version}" ./cmd/ci-runner \ release validate --manifest "$(realpath "$manifest")" --version "$version" >/dev/null -signer="$GITHUB_REPOSITORY/.github/workflows/release.yml" +signer="$GITHUB_REPOSITORY/.github/workflows/release-publish-image.yml" for asset in "${expected[@]}"; do gh attestation verify "dist/$asset" \ --repo "$GITHUB_REPOSITORY" \ diff --git a/.github/scripts/workflow-pin-metadata.test.cjs b/.github/scripts/workflow-pin-metadata.test.cjs index 6255adb..31ba628 100644 --- a/.github/scripts/workflow-pin-metadata.test.cjs +++ b/.github/scripts/workflow-pin-metadata.test.cjs @@ -18,24 +18,25 @@ const advisoryReference = // fails here. It is deliberately independent of the pin: a Dependabot bump // moves every SHA and leaves this inventory untouched, so the bump stays green. const expectedCiWorkflowsCallers = [ - ["ci.yml", ".github/actions/actionlint"], - ["ci.yml", ".github/actions/check-jsonschema"], - ["ci.yml", ".github/actions/check-jsonschema"], - ["ci.yml", ".github/actions/ci-status"], - ["ci.yml", ".github/actions/comment-hygiene"], - ["ci.yml", ".github/actions/editorconfig"], - ["ci.yml", ".github/actions/eol-renormalize"], - ["ci.yml", ".github/actions/exec-bit"], - ["ci.yml", ".github/actions/gitleaks"], - ["ci.yml", ".github/actions/lychee-offline"], - ["ci.yml", ".github/actions/machine-specific-paths"], - ["ci.yml", ".github/actions/markdown"], - ["ci.yml", ".github/actions/pr-contract"], - ["ci.yml", ".github/actions/shellcheck"], - ["ci.yml", ".github/actions/shfmt"], - ["ci.yml", ".github/actions/typos"], - ["ci.yml", ".github/workflows/go-quality.yml"], - ["ci.yml", ".github/workflows/zizmor.yml"], + ["pr-automerge-dependabot.yml", ".github/workflows/pr-automerge-dependabot.yml"], + ["pr-require-checks.yml", ".github/actions/actionlint"], + ["pr-require-checks.yml", ".github/actions/check-comment-markers"], + ["pr-require-checks.yml", ".github/actions/check-exec-bit"], + ["pr-require-checks.yml", ".github/actions/check-jsonschema"], + ["pr-require-checks.yml", ".github/actions/check-jsonschema"], + ["pr-require-checks.yml", ".github/actions/check-line-endings"], + ["pr-require-checks.yml", ".github/actions/check-machine-paths"], + ["pr-require-checks.yml", ".github/actions/editorconfig-checker"], + ["pr-require-checks.yml", ".github/actions/gitleaks"], + ["pr-require-checks.yml", ".github/actions/lychee-offline"], + ["pr-require-checks.yml", ".github/actions/markdownlint"], + ["pr-require-checks.yml", ".github/actions/pr-require-checks/aggregate-results"], + ["pr-require-checks.yml", ".github/actions/pr-require-checks/check-contract"], + ["pr-require-checks.yml", ".github/actions/shellcheck"], + ["pr-require-checks.yml", ".github/actions/shfmt"], + ["pr-require-checks.yml", ".github/actions/typos"], + ["pr-require-checks.yml", ".github/workflows/pr-audit-workflows.yml"], + ["pr-require-checks.yml", ".github/workflows/pr-run-checks-go.yml"], ]; function workflowSource(name) { @@ -177,12 +178,12 @@ test("ci-workflows references use a full SHA with one release version", () => { ciWorkflowsPin(); }); -test("go-quality uses the exact reusable caller contract", () => { +test("pr-run-checks-go uses the exact reusable caller contract", () => { const { sha, version } = ciWorkflowsPin(); - const block = jobBlock(workflowSource("ci.yml"), "go-quality"); + const block = jobBlock(workflowSource("pr-require-checks.yml"), "pr-run-checks-go"); // `if` is admitted because the required-check contract gates every lane job - // on the contract-only predicate, go-quality included: a `labeled`, + // on the contract-only predicate, pr-run-checks-go included: a `labeled`, // `unlabeled` or `edited` event cannot change any Go result, so the lane is // skipped and ci-status carries the recorded `ci-lanes` verdict forward. The // predicate is asserted below so the caller cannot smuggle in an arbitrary @@ -190,21 +191,21 @@ test("go-quality uses the exact reusable caller contract", () => { assert.deepEqual( directMappingKeys(block), ["if", "permissions", "uses", "with"], - "go-quality must not add a runner, caller secrets, or undeclared inputs", + "pr-run-checks-go must not add a runner, caller secrets, or undeclared inputs", ); assert.ok( block.includes( " if: ${{ !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('[\"labeled\",\"unlabeled\"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }}", ), - "go-quality's only condition is the contract-only gate", + "pr-run-checks-go's only condition is the contract-only gate", ); assert.deepEqual(nestedMapping(block, "permissions"), { contents: "read" }); assert.deepEqual(nestedMapping(block, "with"), { config: ".golangci.yml" }); assert.ok( block.includes( - ` uses: melodic-software/ci-workflows/.github/workflows/go-quality.yml@${sha} # ${version}`, + ` uses: melodic-software/ci-workflows/.github/workflows/pr-run-checks-go.yml@${sha} # ${version}`, ), - "go-quality must call the exact released reusable workflow every other reference names", + "pr-run-checks-go must call the exact released reusable workflow every other reference names", ); }); @@ -228,11 +229,11 @@ test("release metadata tracks the same ci-workflows release", () => { }); test("local Go jobs do not duplicate reusable quality checks", () => { - const source = workflowSource("ci.yml"); + const source = workflowSource("pr-require-checks.yml"); assert.doesNotMatch(source, /^ {2}go:\s*$/mu); assert.doesNotMatch(source, /^ {2}go-windows:\s*$/mu); - const crossBuild = jobBlock(source, "go-windows-build").join("\n"); + const crossBuild = jobBlock(source, "build-go-windows").join("\n"); assert.match(crossBuild, /^ {4}runs-on: ubuntu-24\.04$/mu); assert.match(crossBuild, /^ {10}GOOS: windows$/mu); assert.equal((crossBuild.match(/^ {10}go build /gmu) ?? []).length, 2); @@ -240,7 +241,7 @@ test("local Go jobs do not duplicate reusable quality checks", () => { assert.ok(!crossBuild.includes(duplicate), `cross-build must not duplicate ${duplicate}`); } - const fuzz = jobBlock(source, "go-fuzz").join("\n"); + const fuzz = jobBlock(source, "fuzz-go").join("\n"); assert.match( fuzz, /^ {4}if: github\.event_name == 'schedule' \|\| github\.event_name == 'workflow_dispatch'$/mu, @@ -249,28 +250,28 @@ test("local Go jobs do not duplicate reusable quality checks", () => { }); test("ci-status is the stable gateway for every Go lane", () => { - const block = jobBlock(workflowSource("ci.yml"), "ci-status"); + const block = jobBlock(workflowSource("pr-require-checks.yml"), "ci-status"); const expectedNeeds = [ - "markdown", + "markdownlint", "shellcheck", "shfmt", "typos", - "editorconfig", + "editorconfig-checker", "gitleaks", "lychee", - "comment-hygiene", + "check-comment-markers", "actionlint", "jsonschema", - "exec-bit", - "machine-specific-paths", - "eol-renormalize", - "zizmor", - "policy", - "go-quality", - "go-windows-build", - "go-fuzz", - "worker-image", - "dependency-review", + "check-exec-bit", + "check-machine-paths", + "check-line-endings", + "pr-audit-workflows", + "test-policy-contracts", + "pr-run-checks-go", + "build-go-windows", + "fuzz-go", + "build-worker-image", + "review-dependencies", ]; assert.deepEqual(directList(block, "needs"), expectedNeeds); diff --git a/.github/workflows/pr-automerge-dependabot.yml b/.github/workflows/pr-automerge-dependabot.yml new file mode 100644 index 0000000..08b1356 --- /dev/null +++ b/.github/workflows/pr-automerge-dependabot.yml @@ -0,0 +1,27 @@ +name: pr-automerge-dependabot + +# Thin caller of the org's reusable that arms GitHub auto-merge (squash) on a +# Dependabot pull request bumping only allowlisted GitHub Actions publishers +# (`actions/*`, `github/*`, `anthropics/*`) by a patch or minor version. Arming +# never merges: GitHub merges once every required check, `ci-status` included, +# passes. The caller owns the trigger, concurrency and the permission grant; a +# called workflow can only downgrade the caller's grant. Runs on the +# GitHub-hosted `ubuntu-24.04` runner. + +on: + pull_request: + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + +jobs: + pr-automerge-dependabot: + permissions: + contents: write # enablePullRequestAutoMerge requires it. + pull-requests: write # Arm or disarm auto-merge on the PR. + uses: melodic-software/ci-workflows/.github/workflows/pr-automerge-dependabot.yml@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 + with: + runner: ubuntu-24.04 diff --git a/.github/workflows/ci.yml b/.github/workflows/pr-require-checks.yml similarity index 86% rename from .github/workflows/ci.yml rename to .github/workflows/pr-require-checks.yml index f88efd8..3242dfd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/pr-require-checks.yml @@ -1,4 +1,4 @@ -name: ci +name: pr-require-checks on: push: @@ -9,7 +9,7 @@ on: # check has to re-evaluate. Whether such an event is CONTRACT-ONLY (lanes # gated off, ci-status carrying the recorded `ci-lanes` verdict forward) is # decided by one predicate, repeated verbatim in `concurrency.group` and in - # every job's `if:` except `ci-status` and `go-fuzz`: + # every job's `if:` except `ci-status` and `fuzz-go`: # # github.event.pull_request.head.repo.full_name == github.repository && # (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || @@ -20,7 +20,7 @@ on: # pull request is never contract-only — its token is read-only on # `pull_request` whatever `permissions:` requests, so it cannot record lane # state — and runs the full workflow on every event exactly as before. - # `go-fuzz` is left ungated because its own condition already restricts it + # `fuzz-go` is left ungated because its own condition already restricts it # to `schedule` and `workflow_dispatch`, and the predicate is true only on # `pull_request`, so the gate would be a no-op there. types: [opened, synchronize, reopened, edited, labeled, unlabeled] @@ -57,7 +57,7 @@ permissions: # # The cost of the branch: a contract-only run no longer queues behind the full # run whose `ci-lanes` status it carries forward, so the two race. The -# `ci-status` composite closes that with a bounded wait on EARLIER incomplete +# `aggregate-results` composite closes that with a bounded wait on EARLIER incomplete # runs on the same head SHA; see `carry-forward-wait-seconds` on the job below. # # One hazard the branch does not remove, because no concurrency setting both @@ -76,7 +76,7 @@ concurrency: cancel-in-progress: true jobs: - markdown: + markdownlint: name: Markdown if: ${{ !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }} runs-on: ubuntu-24.04 @@ -87,7 +87,7 @@ jobs: with: persist-credentials: false - name: Lint Markdown - uses: melodic-software/ci-workflows/.github/actions/markdown@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/markdownlint@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: config: .markdownlint-cli2.jsonc @@ -102,7 +102,7 @@ jobs: with: persist-credentials: false - name: Lint shell - uses: melodic-software/ci-workflows/.github/actions/shellcheck@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/shellcheck@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: rcfile: .shellcheckrc @@ -117,7 +117,7 @@ jobs: with: persist-credentials: false - name: Check shell formatting - uses: melodic-software/ci-workflows/.github/actions/shfmt@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/shfmt@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 typos: name: Spelling @@ -130,11 +130,11 @@ jobs: with: persist-credentials: false - name: Check spelling - uses: melodic-software/ci-workflows/.github/actions/typos@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/typos@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: config: _typos.toml - editorconfig: + editorconfig-checker: name: EditorConfig if: ${{ !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }} runs-on: ubuntu-24.04 @@ -145,7 +145,7 @@ jobs: with: persist-credentials: false - name: Check EditorConfig conformance - uses: melodic-software/ci-workflows/.github/actions/editorconfig@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/editorconfig-checker@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: config: .editorconfig-checker.json @@ -161,7 +161,7 @@ jobs: fetch-depth: 0 persist-credentials: false - name: Scan for secrets - uses: melodic-software/ci-workflows/.github/actions/gitleaks@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/gitleaks@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: config: .gitleaks.toml @@ -176,11 +176,11 @@ jobs: with: persist-credentials: false - name: Check local links and anchors - uses: melodic-software/ci-workflows/.github/actions/lychee-offline@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/lychee-offline@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: config: lychee.toml - comment-hygiene: + check-comment-markers: name: Comment hygiene if: ${{ !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }} runs-on: ubuntu-24.04 @@ -191,7 +191,7 @@ jobs: with: persist-credentials: false - name: Scan comment hygiene - uses: melodic-software/ci-workflows/.github/actions/comment-hygiene@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/check-comment-markers@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 actionlint: name: Actionlint @@ -204,7 +204,7 @@ jobs: with: persist-credentials: false - name: Lint workflows - uses: melodic-software/ci-workflows/.github/actions/actionlint@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/actionlint@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 jsonschema: name: JSON schemas @@ -217,17 +217,17 @@ jobs: with: persist-credentials: false - name: Validate Dependabot configuration - uses: melodic-software/ci-workflows/.github/actions/check-jsonschema@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/check-jsonschema@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: builtin-schema: vendor.dependabot files: .github/dependabot.yml - name: Validate workflows - uses: melodic-software/ci-workflows/.github/actions/check-jsonschema@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/check-jsonschema@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: builtin-schema: vendor.github-workflows files: .github/workflows/*.yml - exec-bit: + check-exec-bit: name: Executable bits if: ${{ !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }} runs-on: ubuntu-24.04 @@ -238,9 +238,9 @@ jobs: with: persist-credentials: false - name: Check executable bits - uses: melodic-software/ci-workflows/.github/actions/exec-bit@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/check-exec-bit@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 - machine-specific-paths: + check-machine-paths: name: Machine-specific paths if: ${{ !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }} runs-on: ubuntu-24.04 @@ -251,7 +251,7 @@ jobs: with: persist-credentials: false - name: Check machine-specific paths - uses: melodic-software/ci-workflows/.github/actions/machine-specific-paths@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/check-machine-paths@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: # These files assert the official image's fixed in-container runner # home. They contain no host/user path; keep the exception exact. @@ -263,7 +263,7 @@ jobs: :(exclude)worker/entrypoint.sh :(exclude)worker/set-state.sh - eol-renormalize: + check-line-endings: name: EOL normalization if: ${{ !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }} runs-on: ubuntu-24.04 @@ -274,23 +274,23 @@ jobs: with: persist-credentials: false - name: Check index-level EOL drift - uses: melodic-software/ci-workflows/.github/actions/eol-renormalize@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/check-line-endings@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 - zizmor: + pr-audit-workflows: name: Zizmor if: ${{ !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }} permissions: contents: read # Reusable advisory audit reads the checked-in workflow graph. - # Reusable zizmor.yml always declares security-events: write (expressions + # Reusable pr-audit-workflows.yml always declares security-events: write (expressions # are illegal in that scope). Callers must grant it too — reusable # workflows cannot elevate. Lane stays annotations-only # (upload-sarif defaults false); grant write so the job can start. security-events: write # Mandatory match for the reusable's own grant; see above. - uses: melodic-software/ci-workflows/.github/workflows/zizmor.yml@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/workflows/pr-audit-workflows.yml@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: paths: . - policy: + test-policy-contracts: name: Product policy if: ${{ !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }} runs-on: ubuntu-24.04 @@ -316,15 +316,15 @@ jobs: shell: pwsh run: ./scripts/Test-ReleasePins.ps1 - go-quality: + pr-run-checks-go: if: ${{ !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }} permissions: contents: read - uses: melodic-software/ci-workflows/.github/workflows/go-quality.yml@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/workflows/pr-run-checks-go.yml@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: config: .golangci.yml - go-windows-build: + build-go-windows: name: Go Windows builds if: ${{ !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }} runs-on: ubuntu-24.04 @@ -348,7 +348,7 @@ jobs: go build -trimpath -o /tmp/ci-runner.exe ./cmd/ci-runner go build -trimpath -ldflags='-H=windowsgui' -o /tmp/ci-runner-controller.exe ./cmd/ci-runner-controller - go-fuzz: + fuzz-go: name: Go fuzz if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-24.04 @@ -411,7 +411,7 @@ jobs: echo "Docker archive fuzz outcome: $DOCKER_ARCHIVE_OUTCOME" exit 1 - worker-image: + build-worker-image: name: Worker image if: ${{ !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }} runs-on: ubuntu-24.04 @@ -444,7 +444,7 @@ jobs: - name: Verify worker image contract run: ./scripts/verify-worker-image.sh ci-runner-worker:test - dependency-review: + review-dependencies: name: Dependency review if: ${{ github.event_name == 'pull_request' && !(github.event.pull_request.head.repo.full_name == github.repository && (contains(fromJSON('["labeled","unlabeled"]'), github.event.action) || (github.event.action == 'edited' && !github.event.changes.base))) }} runs-on: ubuntu-24.04 @@ -459,26 +459,26 @@ jobs: name: ci-status if: always() needs: - - markdown + - markdownlint - shellcheck - shfmt - typos - - editorconfig + - editorconfig-checker - gitleaks - lychee - - comment-hygiene + - check-comment-markers - actionlint - jsonschema - - exec-bit - - machine-specific-paths - - eol-renormalize - - zizmor - - policy - - go-quality - - go-windows-build - - go-fuzz - - worker-image - - dependency-review + - check-exec-bit + - check-machine-paths + - check-line-endings + - pr-audit-workflows + - test-policy-contracts + - pr-run-checks-go + - build-go-windows + - fuzz-go + - build-worker-image + - review-dependencies runs-on: ubuntu-24.04 timeout-minutes: 15 permissions: @@ -488,14 +488,14 @@ jobs: # permissions block the default is none, so the Actions reads would 403 # and the composite would degrade to the unwaited status read. actions: read # Lists in-flight sibling runs for the carry-forward wait. - # pr-contract upserts the advisory linkage comment and moves the linkage + # check-contract upserts the advisory linkage comment and moves the linkage # label; ci-status records the `ci-lanes` commit status the carry-forward # branch reads back on the next contract-only event. pull-requests: write # Advisory linkage comment and label writes. statuses: write # Records and reads back the `ci-lanes` commit status. steps: - name: Check the pull-request contract - uses: melodic-software/ci-workflows/.github/actions/pr-contract@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/pr-require-checks/check-contract@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: token: ${{ github.token }} # Dependabot and the standards sync open pull requests that close no @@ -507,33 +507,33 @@ jobs: # skipped. exempt-authors: 'dependabot[bot],melodic-standards-sync[bot]' - name: Aggregate lane results - # `!cancelled()` so a failing pr-contract step does not skip the + # `!cancelled()` so a failing check-contract step does not skip the # aggregation: the job still fails on the contract step's exit code, and # the `ci-lanes` status is on the SHA for the next contract-only run. if: ${{ !cancelled() }} - uses: melodic-software/ci-workflows/.github/actions/ci-status@4610c31e92eb1c4b24981e2f200ac87bdb2a1753 # v0.27.1 + uses: melodic-software/ci-workflows/.github/actions/pr-require-checks/aggregate-results@69e506b7c119517ef1dfc421479232b386b93a52 # v0.35.0 with: results: >- - ${{ needs.markdown.result }} + ${{ needs.markdownlint.result }} ${{ needs.shellcheck.result }} ${{ needs.shfmt.result }} ${{ needs.typos.result }} - ${{ needs.editorconfig.result }} + ${{ needs.editorconfig-checker.result }} ${{ needs.gitleaks.result }} ${{ needs.lychee.result }} - ${{ needs.comment-hygiene.result }} + ${{ needs.check-comment-markers.result }} ${{ needs.actionlint.result }} ${{ needs.jsonschema.result }} - ${{ needs.exec-bit.result }} - ${{ needs.machine-specific-paths.result }} - ${{ needs.eol-renormalize.result }} - ${{ needs.zizmor.result }} - ${{ needs.policy.result }} - ${{ needs.go-quality.result }} - ${{ needs.go-windows-build.result }} - ${{ needs.go-fuzz.result }} - ${{ needs.worker-image.result }} - ${{ needs.dependency-review.result }} + ${{ needs.check-exec-bit.result }} + ${{ needs.check-machine-paths.result }} + ${{ needs.check-line-endings.result }} + ${{ needs.pr-audit-workflows.result }} + ${{ needs.test-policy-contracts.result }} + ${{ needs.pr-run-checks-go.result }} + ${{ needs.build-go-windows.result }} + ${{ needs.fuzz-go.result }} + ${{ needs.build-worker-image.result }} + ${{ needs.review-dependencies.result }} treat-skipped-as: pass # Contract-only runs no longer queue behind the full run whose # `ci-lanes` status they read, so each poll lists any in-flight diff --git a/.github/workflows/release.yml b/.github/workflows/release-publish-image.yml similarity index 99% rename from .github/workflows/release.yml rename to .github/workflows/release-publish-image.yml index 760b071..a26a916 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-publish-image.yml @@ -1,4 +1,4 @@ -name: Release +name: release-publish-image on: push: @@ -421,14 +421,14 @@ jobs: gh release verify-asset "$RELEASE_VERSION" "$asset" --repo "$GITHUB_REPOSITORY" gh attestation verify "$asset" \ --repo "$GITHUB_REPOSITORY" \ - --signer-workflow "$GITHUB_REPOSITORY/.github/workflows/release.yml" \ + --signer-workflow "$GITHUB_REPOSITORY/.github/workflows/release-publish-image.yml" \ --source-ref "$GITHUB_REF" \ --source-digest "$GITHUB_SHA" \ --deny-self-hosted-runners done gh attestation verify "oci://ghcr.io/$GITHUB_REPOSITORY@$WORKER_DIGEST" \ --repo "$GITHUB_REPOSITORY" \ - --signer-workflow "$GITHUB_REPOSITORY/.github/workflows/release.yml" \ + --signer-workflow "$GITHUB_REPOSITORY/.github/workflows/release-publish-image.yml" \ --source-ref "$GITHUB_REF" \ --source-digest "$GITHUB_SHA" \ --deny-self-hosted-runners diff --git a/AGENTS.md b/AGENTS.md index 757687d..0c3409e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,7 +8,7 @@ that ships two commands: the operator CLI `./cmd/ci-runner` and the windowless (DPAPI, Docker Desktop, WSL, Task Scheduler), but every Windows-only source file has a `//go:build !windows` (`*_other.go`) counterpart, so the whole module builds, tests, and lints cleanly on the Linux dev VM. Standard build/test/lint -lanes live in `.github/workflows/ci.yml`; the CLI surface is documented in +lanes live in `.github/workflows/pr-require-checks.yml`; the CLI surface is documented in `README.md`. ### Go toolchain (non-obvious) @@ -35,8 +35,8 @@ golangci-lint run ./... golangci-lint must be v2.13.1 or newer: go1.27 support landed in v2.13.0 ([golangci-lint#6643](https://github.com/golangci/golangci-lint/issues/6643)), and older releases reject this module outright. The version is kept aligned with -`GOLANGCI_LINT_VERSION` in the shared `go-quality` reusable that -`.github/workflows/ci.yml` calls, so local lint matches CI. +`GOLANGCI_LINT_VERSION` in the shared `pr-run-checks-go` reusable that +`.github/workflows/pr-require-checks.yml` calls, so local lint matches CI. `GOTOOLCHAIN=go1.27.1` is required — without it, `go install` honors golangci-lint's own (older) `toolchain` directive and produces a binary that @@ -45,9 +45,9 @@ fails the version check above. Keep the pin aligned with `go.mod`'s `go` line. ### Build / test / run - Build (Linux, all packages): `go build ./...` -- Cross-compile the shipped Windows executables (same as the `go-windows-build` +- Cross-compile the shipped Windows executables (same as the `build-go-windows` CI lane): `CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath ./cmd/...` -- Test with the race detector (matches the reusable go-quality lane): +- Test with the race detector (matches the reusable pr-run-checks-go lane): `go test -race ./...` - Run: the CLI resolves a host config **before** dispatching any subcommand (even `help`). Pass `--config ` or set `CI_RUNNER_CONFIG` / @@ -57,8 +57,8 @@ fails the version check above. Keep the pin aligned with `go.mod`'s `go` line. Most `host …` and `secret import` operations require Windows or a live controller and are not exercisable on this VM. -The extensive repo-hygiene lanes in `ci.yml` (markdown, shellcheck, shfmt, -typos, editorconfig, actionlint, zizmor, worker-image, etc.) run through +The extensive repo-hygiene lanes in `pr-require-checks.yml` (markdownlint, shellcheck, shfmt, +typos, editorconfig-checker, actionlint, pr-audit-workflows, build-worker-image, etc.) run through external reusable workflows and are not needed for local Go development. ## Code Review Rules diff --git a/release/dependencies.json b/release/dependencies.json index 5a4093f..db9191f 100644 --- a/release/dependencies.json +++ b/release/dependencies.json @@ -127,8 +127,8 @@ "repositoryPins": [ { "repository": "melodic-software/ci-workflows", - "commit": "4610c31e92eb1c4b24981e2f200ac87bdb2a1753", - "source": "https://github.com/melodic-software/ci-workflows/tree/4610c31e92eb1c4b24981e2f200ac87bdb2a1753" + "commit": "69e506b7c119517ef1dfc421479232b386b93a52", + "source": "https://github.com/melodic-software/ci-workflows/tree/69e506b7c119517ef1dfc421479232b386b93a52" } ], "reusableWorkflows": [] diff --git a/scripts/Test-ReleasePins.ps1 b/scripts/Test-ReleasePins.ps1 index b1ad05c..7b228d2 100644 --- a/scripts/Test-ReleasePins.ps1 +++ b/scripts/Test-ReleasePins.ps1 @@ -218,7 +218,7 @@ foreach ($match in $setupBuildxMatches) { throw 'setup-buildx must not download or execute a version before checksum verification' } } -$releaseWorkflow = Get-Content -Raw -LiteralPath (Join-Path $RepositoryRoot '.github\workflows\release.yml') +$releaseWorkflow = Get-Content -Raw -LiteralPath (Join-Path $RepositoryRoot '.github\workflows\release-publish-image.yml') $releaseTransaction = Get-Content -Raw -LiteralPath (Join-Path $RepositoryRoot '.github\scripts\release-transaction.cjs') $publishEvidenceMatch = [regex]::Match( $releaseWorkflow,