Skip to content
Closed
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
67 changes: 64 additions & 3 deletions .github/workflows/autograder-capstone.yml
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 Down Expand Up @@ -103,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);
}
Loading