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-template.yml
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
Comment on lines +14 to +16

jobs:
check-template:
name: Verify Custom Issue Template
Expand Down Expand Up @@ -89,13 +93,70 @@ jobs:
'Found `' + file + '` with valid `name` and `description` fields. Well done!'
].join('\n');
}
const MARKER = '## Challenge 14:';
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));
Comment on lines +98 to +103
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 14 result:', error.message);
}

- name: Post workflow error notice
if: failure()
uses: actions/github-script@v7
with:
script: |
const MARKER = '## Challenge 14:';
const body = [
'## Challenge 14: Check could not complete',
'',
'The automated issue template 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
Comment on lines +139 to +142
});
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