Repository navigation
ci: add required ci.yml workflow #80
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
ac1b47e
ci: add required ci.yml workflow, claude.yml stub, and markdownlint c…
claude ba77770
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 34cfcb5
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry fbf6bef
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry d81f4db
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 3d3f415
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 1cba40f
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry dd86c03
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 66b5675
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry e9fa317
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 7585bb3
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry f7be869
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry a63b071
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry eb56a5d
fix(ci): fix markdownlint violations to pass CI lint job
Copilot 9c78407
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry bbeec33
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 767a3b9
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 50961db
chore: apply manual instructions [skip ci-relay]
donpetry-bot 40bc409
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry f08308e
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 2c9eac4
chore: apply manual instructions [skip ci-relay]
donpetry-bot 56a44cf
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 0804167
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 7ce134b
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry ba5e3cf
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 03b4349
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 3a909c5
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 5b5716a
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 95f4597
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry 1fab625
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry c716b13
Merge branch 'main' into claude/issue-46-20260508-1409
don-petry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| # CI pipeline for the .github-private repository. | ||
| # Lints markdown, YAML, GitHub Actions, and shell scripts; runs AgentShield; scans for secrets. | ||
| # Standard: https://github.com/petry-projects/.github/blob/main/standards/ci-standards.md | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Lint Markdown | ||
| uses: DavidAnson/markdownlint-cli2-action@6b51ade7a9e4a75a7ad929842dd298a3804ebe8b # v23.1.0 | ||
| with: | ||
| globs: '**/*.md' | ||
|
|
||
| - name: Lint YAML | ||
| run: | | ||
| pip install --quiet --only-binary :all: "yamllint==1.38.0" # v1.38.0 | ||
| yamllint -c <(cat <<'YAMLLINTRC' | ||
| extends: default | ||
| rules: | ||
| line-length: | ||
| max: 250 | ||
| truthy: | ||
| check-keys: false | ||
| document-start: disable | ||
| comments: | ||
| min-spaces-from-content: 1 | ||
| YAMLLINTRC | ||
| ) .github/workflows/ | ||
|
don-petry marked this conversation as resolved.
Resolved
|
||
|
|
||
| - name: Lint GitHub Actions | ||
| run: | | ||
| # Install actionlint via verified download (pinned version + checksum) | ||
| ACTIONLINT_VERSION="1.7.7" | ||
| ACTIONLINT_SHA="023070a287cd8cccd71515fedc843f1985bf96c436b7effaecce67290e7e0757" | ||
| curl --fail --location --retry 3 --retry-delay 5 -so actionlint.tar.gz "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" | ||
| echo "${ACTIONLINT_SHA} actionlint.tar.gz" | sha256sum -c - | ||
| tar xzf actionlint.tar.gz actionlint | ||
| chmod +x actionlint | ||
| rm actionlint.tar.gz | ||
| ./actionlint -ignore 'SC2129' .github/workflows/*.yml | ||
|
|
||
| shellcheck: | ||
| name: ShellCheck | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
don-petry marked this conversation as resolved.
Resolved
|
||
|
|
||
| - name: Run ShellCheck | ||
| run: | | ||
| # Recurse so subdirectories like scripts/lib/ (sourceable libraries) | ||
| # are linted too. -x follows `# shellcheck source=...` directives. | ||
| shopt -s globstar nullglob | ||
| shell_files=(scripts/**/*.sh) | ||
| if [ ${#shell_files[@]} -gt 0 ]; then | ||
| shellcheck --severity=warning -x "${shell_files[@]}" | ||
| else | ||
| echo "No shell scripts found — skipping" | ||
| fi | ||
|
|
||
| agent-security: | ||
| name: Agent Security Scan | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||
|
don-petry marked this conversation as resolved.
Resolved
|
||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Run AgentShield | ||
| run: | | ||
| npx --yes --ignore-scripts ecc-agentshield@1.4.0 scan --path . --format json --min-severity high | ||
|
|
||
| secret-scan: | ||
| name: Secret scan (gitleaks) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| steps: | ||
| - name: Checkout (full history) | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
don-petry marked this conversation as resolved.
Resolved
|
||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Run gitleaks | ||
| uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2.3.9 | ||
| with: | ||
| args: detect --source . --redact --verbose --exit-code 1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # SOURCE OF TRUTH: petry-projects/.github/standards/workflows/claude.yml | ||
| # Standard: petry-projects/.github/standards/ci-standards.md#4-claude-code-claudeyml | ||
| # Reusable: petry-projects/.github/.github/workflows/claude-code-reusable.yml | ||
| # | ||
| # AGENTS — READ BEFORE EDITING: | ||
| # • This file is a THIN CALLER STUB. All Claude Code logic, the prompt, | ||
| # allowedTools, and trigger gating live in the reusable workflow above. | ||
| # • You MAY change: nothing in this file in normal use. Adopt verbatim. | ||
| # • You MUST NOT change: trigger events, job permissions, the `uses:` line, | ||
| # or `secrets: inherit`. These are required for the reusable to work. | ||
| # • If you need different behaviour, open a PR against the reusable in the | ||
| # central repo. The change will propagate everywhere on next run. | ||
| # | ||
| # WHY THIS FILE IS IMMUTABLE (agents: read before opening any PR here): | ||
| # Anthropic's OIDC token endpoint validates that this file on a PR branch | ||
| # is byte-for-byte identical to the file on the default branch. Any diff — | ||
| # even a whitespace or comment change — causes the token exchange to fail: | ||
| # "401 Unauthorized — Workflow validation failed" | ||
| # Claude Code will not run on that PR. Do not open compliance PRs against | ||
| # this file. Do not SHA-pin the `uses:` line — internal reusable workflow | ||
| # refs are exempt from the Action Pinning Policy (ci-standards.md | ||
| # §Action Pinning Policy). The @v2 tag is the correct, stable reference. | ||
| # | ||
| # NARROW GUARD: The paths-ignore setting (lines 38-39) under pull_request | ||
| # prevents the workflow from triggering only when the PR's entire changeset | ||
| # is limited to claude.yml alone. PRs that modify claude.yml *plus other | ||
| # files* will still trigger the workflow and hit the 401 error at token | ||
| # exchange. Other triggers (issue_comment, pull_request_review_comment, | ||
| # issues, check_run) are unaffected by paths-ignore and run as configured. | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # | ||
| # Claude Code — thin caller that delegates to the org-level reusable workflow. | ||
| # To adopt: copy this file to .github/workflows/claude.yml in your repo. | ||
| # Required org/repo secret: CLAUDE_CODE_OAUTH_TOKEN | ||
| # Optional org/repo secret: GH_PAT_WORKFLOWS (PAT with `workflow` scope — | ||
| # required if Claude needs to push changes to .github/workflows/*.yml) | ||
|
|
||
| name: Claude Code | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| types: [opened, reopened, synchronize] | ||
| paths-ignore: | ||
| - '.github/workflows/claude.yml' # OIDC invariant — see header above | ||
| issue_comment: | ||
| types: [created] | ||
| pull_request_review_comment: | ||
| types: [created] | ||
| issues: | ||
| types: [labeled] | ||
| check_run: | ||
| types: [completed] | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| claude-code: | ||
| uses: petry-projects/.github/.github/workflows/claude-code-reusable.yml@v2 | ||
| secrets: inherit | ||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
| pull-requests: write | ||
| issues: write | ||
| actions: read | ||
| checks: read |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| { | ||
| // Markdownlint configuration for .github-private. | ||
| // | ||
| // Rules are calibrated against the existing file baseline (2026-05-08). | ||
| // Rules listed as "disabled" below had widespread pre-existing violations | ||
| // when markdownlint CI was introduced. Enable them one by one via a | ||
| // follow-up PR once the violations are fixed. | ||
| // | ||
| // Reference: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md | ||
| "config": { | ||
| "default": true, | ||
|
|
||
| // Line length — relaxed to cover docs with long tables/URLs. | ||
| // Matches the spirit of the org yamllint config (line-length: 200), | ||
| // but raised higher for investigation reports with long prose lines. | ||
| "MD013": { | ||
| "line_length": 400, | ||
| "heading_line_length": 400, | ||
| "code_block_line_length": 400 | ||
| }, | ||
|
|
||
| // -- Rules disabled pending cleanup of pre-existing violations -- | ||
| // MD022: blanks-around-headings — many docs use compact heading+list blocks. | ||
| "MD022": false, | ||
| // MD026: trailing-punctuation — headings like "### Issue: Token expired" and | ||
| // "### The agent isn't working, help!" would require rewrites. | ||
| "MD026": false, | ||
| // MD031: blanks-around-fences — widespread in IMPLEMENTATION.md etc. | ||
| "MD031": false, | ||
| // MD032: blanks-around-lists — widespread across most docs. | ||
| "MD032": false, | ||
| // MD034: no-bare-urls — BOT_SETUP.md uses bare URLs in a setup guide. | ||
| "MD034": false, | ||
| // MD040: fenced-code-language — many code blocks lack language specifiers. | ||
| "MD040": false, | ||
| // MD041: first-line-heading — agents/*.md files are prompt files, not docs. | ||
| "MD041": false, | ||
| // MD029: ol-prefix — some docs use cross-section sequential numbering (1/2/3) | ||
| // that renderers handle correctly but linter expects 1/1/1 style. | ||
| "MD029": false, | ||
| // MD060: table-column-style — newer rule; many tables use compact style. | ||
| "MD060": false | ||
| }, | ||
| // Exclude generated/internal directories from linting. | ||
| "ignores": [ | ||
| ".claude/**", | ||
| "frameworks/**", | ||
| "prompts/**" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.