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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ permissions:
contents: read
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
validate-agent:
name: Verify Agent File
Expand All @@ -28,44 +32,42 @@ jobs:
run: |
# Find new/modified .md files in agents/ or community-agents/
AGENTS=$(find agents community-agents -name '*.md' 2>/dev/null || true)

if [ -z "$AGENTS" ]; then
echo "found=false" >> "$GITHUB_OUTPUT"
exit 0
fi

echo "found=true" >> "$GITHUB_OUTPUT"
FIRST=$(echo "$AGENTS" | head -1)
echo "file=$FIRST" >> "$GITHUB_OUTPUT"
CHECK_FILE="/tmp/capstone-agent.md"
sed '1s/^\xEF\xBB\xBF//' "$FIRST" > "$CHECK_FILE"


ERRORS=""

# Check YAML frontmatter exists (starts with ---)
if head -1 "$CHECK_FILE" | grep -q '^---'; then
if head -1 "$FIRST" | grep -q '^---'; then
echo "has_frontmatter=true" >> "$GITHUB_OUTPUT"
else
echo "has_frontmatter=false" >> "$GITHUB_OUTPUT"
ERRORS="missing YAML frontmatter"
fi

# Check for responsibilities section
if grep -qi '## responsibilities\|## what this agent does' "$CHECK_FILE"; then
if grep -qi '## responsibilities\|## what this agent does' "$FIRST"; then
echo "has_responsibilities=true" >> "$GITHUB_OUTPUT"
else
echo "has_responsibilities=false" >> "$GITHUB_OUTPUT"
ERRORS="$ERRORS${ERRORS:+, }missing responsibilities section"
fi

# Check for guardrails section
if grep -qi '## guardrails\|## limitations\|## boundaries' "$CHECK_FILE"; then
if grep -qi '## guardrails\|## limitations\|## boundaries' "$FIRST"; then
echo "has_guardrails=true" >> "$GITHUB_OUTPUT"
else
echo "has_guardrails=false" >> "$GITHUB_OUTPUT"
ERRORS="$ERRORS${ERRORS:+, }missing guardrails section"
fi

echo "errors=$ERRORS" >> "$GITHUB_OUTPUT"

- name: Post result
Expand Down Expand Up @@ -105,13 +107,70 @@ jobs:
'Excellent capstone work!'
].join('\n');
}
const MARKER = '## Challenge 16:';
try {
await github.rest.issues.createComment({
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
issue_number: context.issue.number
});
const existing = comments.find(c => c.user.type === 'Bot' && c.body.includes(MARKER));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
});
}
} catch (error) {
console.error('Could not post Challenge 16 result:', error.message);
}

- name: Post workflow error notice
if: failure()
uses: actions/github-script@v7
with:
script: |
const MARKER = '## Challenge 16:';
const body = [
'## Challenge 16: Check could not complete',
'',
'The automated agent file check ran into an unexpected error. Your work is not affected.',
'Keep going and ask your facilitator, or mention @facilitator in a comment.',
'',
'---',
'*Automated message from Learning Room Bot.*'
].join('\n');
try {
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
const existing = comments.find(c => c.user.type === 'Bot' && c.body.includes(MARKER));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
});
}
} catch (err) {
console.error('Could not post error notice:', err.message);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ permissions:
contents: read
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
check-conflict-markers:
name: Verify Conflict Resolution
Expand Down Expand Up @@ -75,13 +79,70 @@ jobs:
'No conflict markers found and the file has substantive content. Well done!'
].join('\n');
}
const MARKER = '## Challenge 7:';
try {
await github.rest.issues.createComment({
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
issue_number: context.issue.number
});
const existing = comments.find(c => c.user.type === 'Bot' && c.body.includes(MARKER));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
});
}
} catch (error) {
console.error('Could not post Challenge 7 result:', error.message);
}

- name: Post workflow error notice
if: failure()
uses: actions/github-script@v7
with:
script: |
const MARKER = '## Challenge 7:';
const body = [
'## Challenge 7: Check could not complete',
'',
'The automated conflict marker check ran into an unexpected error. Your work is not affected.',
'Keep going and ask your facilitator, or mention @facilitator in a comment.',
'',
'---',
'*Automated message from Learning Room Bot.*'
].join('\n');
try {
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
const existing = comments.find(c => c.user.type === 'Bot' && c.body.includes(MARKER));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
});
}
} catch (err) {
console.error('Could not post error notice:', err.message);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ permissions:
contents: read
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
check-local-commit:
name: Verify Local Commit Exists
Expand Down Expand Up @@ -66,13 +70,70 @@ jobs:
'Your local Git workflow is working. Well done!'
].join('\n');
}
const MARKER = '## Challenge 10:';
try {
await github.rest.issues.createComment({
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
issue_number: context.issue.number
});
const existing = comments.find(c => c.user.type === 'Bot' && c.body.includes(MARKER));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
});
}
} catch (error) {
console.error('Could not post Challenge 10 result:', error.message);
}

- name: Post workflow error notice
if: failure()
uses: actions/github-script@v7
with:
script: |
const MARKER = '## Challenge 10:';
const body = [
'## Challenge 10: Check could not complete',
'',
'The automated local commit check ran into an unexpected error. Your work is not affected.',
'Keep going and ask your facilitator, or mention @facilitator in a comment.',
'',
'---',
'*Automated message from Learning Room Bot.*'
].join('\n');
try {
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
const existing = comments.find(c => c.user.type === 'Bot' && c.body.includes(MARKER));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
});
}
} catch (err) {
console.error('Could not post error notice:', err.message);
}
Loading
Loading