Skip to content

Commit 0584d01

Browse files
rsafierclaude
andcommitted
ci: inline workflows for public repo compatibility
Public repos cannot use reusable workflows from private repos (GitHub platform constraint). Replace all 4 reusable workflow callers with self-contained inline workflows. SHA-pinned actions, timeout controls, and org-owner guards preserved. Resolves MonumentalSystems/.github-private#28 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 97b233c commit 0584d01

File tree

4 files changed

+204
-19
lines changed

4 files changed

+204
-19
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,33 @@ on:
1313
- 'global.json'
1414

1515
jobs:
16-
ci:
17-
uses: MonumentalSystems/.github-private/.github/workflows/ci.yml@main
18-
with:
19-
dotnet-version: '10.0.x'
16+
build:
17+
name: Build
18+
# No org-owner guard — CI uses no secrets and should run for fork PRs
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
24+
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
27+
with:
28+
dotnet-version: '10.0.x'
29+
30+
- name: Cache NuGet packages
31+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
32+
with:
33+
path: ~/.nuget/packages
34+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props') }}
35+
restore-keys: |
36+
${{ runner.os }}-nuget-
37+
38+
- name: Restore dependencies
39+
run: dotnet restore
40+
41+
- name: Build
42+
run: dotnet build --no-restore
43+
44+
- name: Test
45+
run: dotnet test --no-build

.github/workflows/claude-ci-auto-fix.yml

Lines changed: 98 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,101 @@ permissions:
1616

1717
jobs:
1818
auto-fix:
19-
# Security: only run in MonumentalSystems org — see docs/PIPELINE-SECURITY.md
20-
if: github.repository_owner == 'MonumentalSystems'
21-
uses: MonumentalSystems/.github-private/.github/workflows/claude-ci-auto-fix.yml@main
22-
secrets: inherit
23-
with:
24-
ci-workflow-name: 'CI'
25-
project-description: 'MercuryBank API helper library — .NET NuGet package'
19+
# Security: only run in MonumentalSystems org + only fix Claude's branches
20+
if: |
21+
github.repository_owner == 'MonumentalSystems' &&
22+
github.event.workflow_run.conclusion == 'failure' &&
23+
github.event.workflow_run.pull_requests[0] &&
24+
startsWith(github.event.workflow_run.head_branch, 'claude/')
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 60
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
31+
with:
32+
ref: ${{ github.event.workflow_run.head_branch }}
33+
fetch-depth: 0
34+
35+
- name: Get CI failure details
36+
id: failure_details
37+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
38+
with:
39+
script: |
40+
const run = await github.rest.actions.getWorkflowRun({
41+
owner: context.repo.owner,
42+
repo: context.repo.repo,
43+
run_id: ${{ github.event.workflow_run.id }}
44+
});
45+
46+
const jobs = await github.rest.actions.listJobsForWorkflowRun({
47+
owner: context.repo.owner,
48+
repo: context.repo.repo,
49+
run_id: ${{ github.event.workflow_run.id }}
50+
});
51+
52+
const failedJobs = jobs.data.jobs.filter(job => job.conclusion === 'failure');
53+
54+
let errorLogs = [];
55+
for (const job of failedJobs) {
56+
try {
57+
const logs = await github.rest.actions.downloadJobLogsForWorkflowRun({
58+
owner: context.repo.owner,
59+
repo: context.repo.repo,
60+
job_id: job.id
61+
});
62+
const logText = typeof logs.data === 'string' ? logs.data : String(logs.data);
63+
errorLogs.push({
64+
jobName: job.name,
65+
logs: logText.slice(-3000)
66+
});
67+
} catch (e) {
68+
errorLogs.push({
69+
jobName: job.name,
70+
logs: `Failed to retrieve logs: ${e.message}`
71+
});
72+
}
73+
}
74+
75+
return {
76+
runUrl: run.data.html_url,
77+
prNumber: run.data.pull_requests[0]?.number,
78+
failedJobs: failedJobs.map(j => j.name),
79+
errorLogs: errorLogs
80+
};
81+
82+
- name: Fix CI failures with Claude
83+
id: claude
84+
uses: anthropics/claude-code-action@f669191d7d1e67f08a54b0c11cf5683a9a391951 # v1
85+
with:
86+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
87+
github_token: ${{ secrets.ORG_PAT || github.token }}
88+
use_commit_signing: true
89+
track_progress: true
90+
plugin_marketplaces: |
91+
https://github.com/richlander/dotnet-skills.git
92+
plugins: |
93+
dotnet-skills@richlander-dotnet-skills
94+
prompt: |
95+
The CI build/test failed on this branch. Analyze the error logs and fix the code.
96+
97+
Failed CI Run: ${{ fromJSON(steps.failure_details.outputs.result).runUrl }}
98+
PR: #${{ fromJSON(steps.failure_details.outputs.result).prNumber }}
99+
Failed Jobs: ${{ join(fromJSON(steps.failure_details.outputs.result).failedJobs, ', ') }}
100+
Branch: ${{ github.event.workflow_run.head_branch }}
101+
Repository: ${{ github.repository }}
102+
103+
Error logs:
104+
${{ toJSON(fromJSON(steps.failure_details.outputs.result).errorLogs) }}
105+
106+
Instructions:
107+
- This is a MercuryBank API helper library — .NET NuGet package
108+
- Read CLAUDE.md for project conventions if it exists
109+
- Run `dotnet build` to verify your fix compiles
110+
- Run `dotnet test --filter "Category!=Integration&Category!=Skipped"` to verify tests pass
111+
- Commit the fix and push to the same branch
112+
- Comment on the PR explaining what was wrong and how you fixed it
113+
claude_args: |
114+
--model claude-opus-4-6
115+
--max-turns 30
116+
--allowedTools "Bash(git:*)" "Bash(dotnet:*)" "Bash(gh:*)" "Read" "Edit" "Write" "Glob" "Grep" "WebFetch" "WebSearch"

.github/workflows/claude-code-review.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,38 @@ permissions:
1111
id-token: write
1212

1313
jobs:
14-
review:
15-
# Security: only run in MonumentalSystems org — see docs/PIPELINE-SECURITY.md
14+
claude-review:
15+
# Security: only run in MonumentalSystems org — see PIPELINE-SECURITY.md
1616
if: github.repository_owner == 'MonumentalSystems'
17-
uses: MonumentalSystems/.github-private/.github/workflows/claude-code-review.yml@main
18-
secrets: inherit
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 30
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
23+
with:
24+
fetch-depth: 1
25+
26+
- name: Run Claude Code Review
27+
id: claude-review
28+
uses: anthropics/claude-code-action@f669191d7d1e67f08a54b0c11cf5683a9a391951 # v1
29+
with:
30+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
31+
use_sticky_comment: true
32+
plugin_marketplaces: |
33+
https://github.com/anthropics/claude-code.git
34+
https://github.com/richlander/dotnet-skills.git
35+
plugins: |
36+
code-review@claude-code-plugins
37+
dotnet-skills@richlander-dotnet-skills
38+
prompt: |
39+
/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}
40+
41+
IMPORTANT: After completing your review, you MUST post your findings as a comment on the PR using:
42+
gh pr comment ${{ github.event.pull_request.number }} --body "<your review in markdown>"
43+
44+
Do NOT rely on sticky comments to post your review — post your review directly via gh pr comment.
45+
If you need to verify compilation or tests, use dotnet build and dotnet test.
46+
claude_args: |
47+
--max-turns 15
48+
--allowedTools "Bash(gh pr review:*),Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr comment:*),Bash(gh api:*),Bash(dotnet build*),Bash(dotnet test*)"

.github/workflows/claude.yml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,45 @@ permissions:
1919

2020
jobs:
2121
claude:
22-
# Security: only run in MonumentalSystems org — see docs/PIPELINE-SECURITY.md
23-
if: github.repository_owner == 'MonumentalSystems'
24-
uses: MonumentalSystems/.github-private/.github/workflows/claude-assistant.yml@main
25-
secrets: inherit
22+
# Security: only run in MonumentalSystems org — see PIPELINE-SECURITY.md
23+
if: |
24+
github.repository_owner == 'MonumentalSystems' && (
25+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
26+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
27+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
28+
(github.event_name == 'issues' && (
29+
contains(github.event.issue.body, '@claude') ||
30+
contains(github.event.issue.title, '@claude') ||
31+
github.event.action == 'assigned' ||
32+
github.event.action == 'labeled'
33+
))
34+
)
35+
runs-on: ubuntu-latest
36+
timeout-minutes: 60
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
41+
with:
42+
fetch-depth: 1
43+
44+
- name: Run Claude Code
45+
id: claude
46+
uses: anthropics/claude-code-action@f669191d7d1e67f08a54b0c11cf5683a9a391951 # v1
47+
with:
48+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
49+
github_token: ${{ secrets.ORG_PAT || github.token }}
50+
use_commit_signing: true
51+
assignee_trigger: 'claude'
52+
label_trigger: 'claude'
53+
track_progress: true
54+
additional_permissions: |
55+
actions: read
56+
plugin_marketplaces: |
57+
https://github.com/richlander/dotnet-skills.git
58+
plugins: |
59+
dotnet-skills@richlander-dotnet-skills
60+
claude_args: |
61+
--model claude-opus-4-6
62+
--max-turns 50
63+
--allowedTools "Bash(git:*)" "Bash(dotnet:*)" "Bash(gh:*)" "WebFetch" "WebSearch"

0 commit comments

Comments
 (0)