Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
27 changes: 15 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
time: '05:20'
timezone: America/New_York
cooldown:
default-days: 7
default-days: 3

Check warning on line 11 in .github/dependabot.yml

View workflow job for this annotation

GitHub Actions / Zizmor / zizmor

dependabot-cooldown

dependabot.yml:11: insufficient cooldown in Dependabot updates: insufficient default-days configured (less than 7)
open-pull-requests-limit: 5
commit-message:
prefix: build
Expand All @@ -31,7 +31,7 @@
time: '05:30'
timezone: America/New_York
cooldown:
default-days: 7
default-days: 3

Check warning on line 34 in .github/dependabot.yml

View workflow job for this annotation

GitHub Actions / Zizmor / zizmor

dependabot-cooldown

dependabot.yml:34: insufficient cooldown in Dependabot updates: insufficient default-days configured (less than 7)
open-pull-requests-limit: 5
commit-message:
prefix: build
Expand All @@ -48,22 +48,25 @@
time: '05:40'
timezone: America/New_York
cooldown:
default-days: 7
default-days: 3

Check warning on line 51 in .github/dependabot.yml

View workflow job for this annotation

GitHub Actions / Zizmor / zizmor

dependabot-cooldown

dependabot.yml:51: insufficient cooldown in Dependabot updates: insufficient default-days configured (less than 7)
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:
- '*'
2 changes: 1 addition & 1 deletion .github/scripts/verify-existing-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
85 changes: 43 additions & 42 deletions .github/scripts/workflow-pin-metadata.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -177,34 +178,34 @@ 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
// condition; every other key stays closed.
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",
);
});

Expand All @@ -228,19 +229,19 @@ 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);
for (const duplicate of ["go test", "go vet", "go mod", "govulncheck", "golangci-lint"]) {
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,
Expand All @@ -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);

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/pr-automerge-dependabot.yml
Original file line number Diff line number Diff line change
@@ -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
Comment thread
kyle-sexton marked this conversation as resolved.
Resolved
with:
runner: ubuntu-24.04
Loading
Loading