Skip to content

ci: set up CI for the .github repo - #16

Merged
uniqueg merged 5 commits into
mainfrom
ci/set-up-ci
Oct 28, 2026
Merged

uniqueg merged 5 commits into
mainfrom
ci/set-up-ci

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Sets up the .github repo so that it can host shared composite actions:

  • .pre-commit-config.yaml: the hooks the other repos use for the same files (pre-commit-hooks, gitleaks incl. the manual-stage gitleaks-all, actionlint), plus check-jsonschema for GitHub's schemas (issue forms and their config.yml, workflows, action.yml in actions/<name>/, Dependabot) and markdownlint-cli2 for Markdown. All revisions pinned to commits (# frozen:).
  • .github/workflows/ci.yml (CI): lint (Lint) runs the hooks; passed (CI passed) is the gate (needs: every other job, if: always(), fails on anything but success). No paths: filters, permissions: contents: read (gate: {}), action SHAs pinned. There is no test job yet, as there is no action to test; ci: add a PR title check action #13 adds it with the first action.
  • .github/dependabot.yml: grouped monthly updates for github-actions (directories: ["/", "/actions/*"], so new actions need no new entry) and pre-commit.
  • .github/CODEOWNERS: catch-all plus /actions/ and /.github/workflows/, in the org's format.
  • RELEASING.md (tags, immutable releases, no moving major tags, breaking changes only in majors, release notes format) and a Development section in the README; .editorconfig as in the other repos.

Closes #12

Light lane

CI and docs only; no secrets, no permissions beyond contents: read, no release workflow. I reviewed the diff myself instead of running the reviewer subagents.

Verification

  • pre-commit run --all-files and pre-commit run --all-files --hook-stage manual gitleaks-all: all passed.
  • Broken on purpose (then reverted): an issue form with an unknown field type, an invalid config.yml value, a duplicate key in ci.yml, an invalid Dependabot interval, Markdown heading errors and an invalid actions/broken/action.yml. Each one made its hook fail (check-yaml, the check-jsonschema hooks, actionlint, markdownlint-cli2); a valid actions/good/action.yml passed.
  • actionlint with shellcheck and zizmor --offline on ci.yml: no findings.
  • CI: run 40635540952 passed (Lint, CI passed); every hook ran on the runner.

Declined review findings

  • Sourcery, "skipped checks block valid pull requests" (gate): deliberate. The gate allows only intended skips, listed explicitly, and this workflow has none; an unexpected skip must not turn CI passed green.

Maintainer settings (not in this PR)

These need an admin:

  • Ruleset on main requiring CI passed (source: GitHub Actions), once the check has reported on this PR.
  • CodeQL default setup with the actions language.
  • Immutable releases, before the first tag (v1.0.0 comes with the first action).

🤖 Generated with Claude Code

uniqueg and others added 4 commits October 28, 2026 05:50
Lint YAML (syntax and the GitHub schemas of issue forms, workflows,
composite actions and the Dependabot configuration), Markdown
(markdownlint), secrets (gitleaks) and workflows (actionlint), with
hook revisions pinned to commits, as in the other repositories of the
organisation. Add an .editorconfig consistent with the hooks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run the pre-commit hooks in a Lint job on pull requests and pushes to
main, with pinned action SHAs and read-only permissions. The gate job
passed (CI passed) needs every other job and is the only check to
require.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Group monthly updates of action pins (workflows and every composite
action in actions/*) and of pre-commit hook revisions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Sets up the .github repository as a governed home for shared composite actions by adding pinned pre-commit and schema/security validation, SHA-pinned CI with an aggregate required-check gate, Dependabot and ownership configuration, and documented development and immutable release practices.

Flow diagram for the CI lint and gate workflow

flowchart LR
    PR["Pull request or push to main"] --> Lint["Lint job"]
    Lint --> Hooks["pre-commit run --all-files"]
    Lint --> Secrets["pre-commit run --all-files --hook-stage manual gitleaks-all"]
    Hooks --> Gate["CI passed gate"]
    Secrets --> Gate
    Gate --> Result["jq checks needs results"]
    Result --> Status["Required check succeeds or fails"]
Loading

File-Level Changes

Change Details Files
Established a repository-wide pre-commit linting and security validation baseline with pinned tool revisions.
  • Added syntax, whitespace, merge-conflict, large-file, secret-scanning, Markdown, actionlint, and GitHub schema checks.
  • Added schema validation for issue forms, issue configuration, workflows, composite actions, and Dependabot.
  • Configured a manual full-repository gitleaks scan for CI.
.pre-commit-config.yaml
Implemented CI with a lint job and a single required aggregate gate.
  • Runs all pre-commit hooks and the manual gitleaks scan on pushes to main and pull requests.
  • Pins third-party actions by SHA, limits permissions to read-only contents, caches hook environments, and cancels superseded PR runs.
  • Uses an always-running CI passed job to fail when any required job is unsuccessful, while leaving room for future action tests.
.github/workflows/ci.yml
Added automated dependency update coverage and ownership rules for the shared-actions repository.
  • Configured monthly grouped updates for GitHub Actions and pre-commit hooks, including all current and future composite-action directories.
  • Added catch-all, actions, and workflow CODEOWNERS entries.
.github/dependabot.yml
.github/CODEOWNERS
Documented repository development, formatting, and composite-action release conventions.
  • Added editor settings consistent with the other repositories.
  • Documented local pre-commit usage and the shared-action layout.
  • Defined signed immutable semantic releases, commit pinning, major-version compatibility rules, and release-note structure.
.editorconfig
README.md
RELEASING.md

Assessment against linked issues

Issue Objective Addressed Explanation
#12 Set up CI with linting, tests for composite actions, and a CI passed gate that runs on pull requests without path filters. ❌ The workflow adds linting and the required gate, with no paths filters, but it has no test job. The PR defers adding that job until the first action lands, while the issue calls for a test job in the CI workflow.
#12 Configure Dependabot and CODEOWNERS, and enable the required- check and CodeQL repository settings. ❌ Dependabot and CODEOWNERS are configured, but the ruleset requiring CI passed and CodeQL default setup are left as maintainer actions outside this PR.
#12 Document the versioning and release process for shared composite actions. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@uniqueg
uniqueg marked this pull request as ready for review October 28, 2026 05:06

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/ci.yml" line_range="67" />
<code_context>
+        run: |
+          failed="$(jq -r '
+            to_entries[]
+            | select(.value.result != "success")
+            | "\(.key): \(.value.result)"' <<< "${NEEDS}")"
+          if [[ -n "${failed}" ]]; then
</code_context>
<issue_to_address>
**Skipped checks block valid pull requests**

When a job is skipped by an `if:` condition, the `jq` filter populates `failed` for every result other than `success`, including `skipped`, so the gate exits nonzero and the required `CI passed` check blocks otherwise valid pull requests.

Change the filter so skipped jobs are not included in `failed`.
</issue_to_address>

### Comment 2
<location path="README.md" line_range="35" />
<code_context>
+
+```sh
+pre-commit install
+pre-commit run --all-files
+```
</code_context>
<issue_to_address>
**Local checks miss unstaged secrets**

When a developer follows the documented checks and a secret is outside the staged diff, `pre-commit run --all-files` omits the manual-stage `gitleaks-all` hook, so the full checkout is not scanned and the developer's local checks miss the secret.

Add a command that runs `gitleaks-all` across all files at the manual stage.

Also at `.pre-commit-config.yaml:41`.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: .github/workflows/ci.yml:67, README.md:35


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .github/workflows/ci.yml Resolved
Comment thread README.md Resolved
@uniqueg
uniqueg merged commit 487f286 into main Oct 28, 2026
3 checks passed
@uniqueg
uniqueg deleted the ci/set-up-ci branch October 28, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: set up CI for the .github repo

1 participant