Post to GitHub Discussions
Creates a GitHub Discussion for each assessment run. Useful for class-wide visibility or when instructors prefer a forum-style record of assessments.
If Discussions are not enabled on the repository when the action runs, they are enabled automatically. The named category (e.g. Assessments) must already exist in the repository's Discussions settings before the first run, or the action will fail.
Each run supersedes the previous: existing open assessment discussions for the same branch are deleted before a new one is created.
Copy this file to .github/workflows/grill-my-code.yml in the student repository.
name: Code Assessment
on:
pull_request:
types: [opened, synchronize]
jobs:
generate-questions:
runs-on: ubuntu-latest
permissions:
contents: read
discussions: write # required to create the GitHub Discussion
administration: write # required only if Discussions may not yet be enabled
models: read # required to call GitHub Models API
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history required for diff resolution
- uses: NSCC-ITC-Assessment/GrillMyCode@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
post_discussion: "true"
discussion_category: "Assessments"
post_pr_comment: "false"
num_questions: "5"
additional_context: "Assignment 4 — Database design and SQL queries"
Prerequisites
- Create a Discussion category named
Assessments(or whatever you pass asdiscussion_category) in Settings → Discussions on the repository before the first run - Add
administration: writeto the permissions block the first time, so the action can enable Discussions if they are not already on. You can remove it once Discussions are confirmed enabled
:::note GraphQL API
The Discussions API uses GraphQL, not REST. The action handles this transparently — no additional configuration is needed.
:::