Skip to content

ci: add the reusable DCO workflow called by every public repository - #5

Merged
florianamette merged 1 commit into
mainfrom
refactor/GH-002-reusable-dco
Nov 8, 2026
Merged

florianamette merged 1 commit into
mainfrom
refactor/GH-002-reusable-dco

Conversation

@florianamette

@florianamette florianamette commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds .github/workflows/dco.yml as a reusable workflow (on: workflow_call). It holds the DCO sign-off check that is currently copy-pasted into agent, server, ml, rules, rig and scenarios. Each of those repositories gets a follow-up PR that swaps its copy for a short caller:

on:
  pull_request:
permissions:
  contents: read
jobs:
  dco:
    uses: synthaea-lab/.github/.github/workflows/dco.yml@main

Why

Clean-code charter, "DRY CI": when CI duplication is large, use reusable workflows. Six repositories carry the same 43-line workflow (five copies are byte-identical, and scenarios differs by one comment line). A fix to the check or a bump of the actions/checkout pin currently has to land six times.

Safety net

  • The check script is copied unchanged from the existing copies. The only additions are the workflow_call trigger, a pull_request trigger so this repository's own PRs run the check (this PR runs it too), and if: github.event_name == 'pull_request' so a caller wired to another event skips instead of checking an empty range.
  • Permissions stay contents: read, and checkout stays SHA-pinned with persist-credentials: false. Inside a reusable workflow, github.event is the caller's pull_request event and checkout fetches the caller's repository, so the check runs exactly as it did in each repository.

Verification

  • uvx --from actionlint-py actionlint -shellcheck <shellcheck-py> .github/workflows/dco.yml: exit 0 (actionlint 1.7.12).
  • I extracted the run: script and ran shellcheck -s bash on it: clean.
  • I ran the script against a scratch repository: signed commits pass (exit 0), an unsigned commit fails with the ::error:: line (exit 1), a sign-off that names a different email fails (exit 1), and a [bot]@users.noreply.github.com author is exempt (exit 0).
  • Cross-repository call, end to end: ci: call the shared DCO workflow instead of a local copy rig#2 temporarily called this workflow at this PR's branch. Run 42531375126 (signed commit) passed as dco / dco. Run 42532746308 (with an extra unsigned commit) failed on the sign-off step with 31aa6e9 tmp: unsigned commit ...: no 'Signed-off-by: ... <author email>' line. This PR's own pull_request run (42531354564) passed.

Caller PRs: synthaea-lab/agent#105, synthaea-lab/server#32, synthaea-lab/ml#12, synthaea-lab/rules#5, synthaea-lab/scenarios#3, synthaea-lab/rig#2.

Merge order: merge this PR first. The caller PRs reference @main and stay red until it lands.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AuFi2XQ6ctHQ1eNQ4Fz8ud

The DCO sign-off check was copy-pasted byte for byte into each public
repository's .github/workflows/dco.yml. Keep the one copy here, callable
with `on: workflow_call`, so a fix or an action pin bump lands once.

The check itself is unchanged. It also runs on this repository's own pull
requests, so a change to it is exercised before callers pick it up, and
the job skips on any event other than pull_request, where there is no
base..head range to check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AuFi2XQ6ctHQ1eNQ4Fz8ud
Signed-off-by: Florian Amette (F4K) <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T22:40:46.503452Z 697275c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant