Skip to main content

Inputs & Outputs

Inputs

InputRequiredDefaultDescription
github_tokenYes${{ github.token }}GitHub token for API access and GitHub Models credential
ai_providerNogithub-modelsAI provider: github-models, openai, openrouter, or azure-openai
ai_modelNogpt-4oModel identifier for the chosen provider
ai_retry_max_attemptsNo5Total number of attempts (initial + retries) when calling the AI provider. Retries are triggered by transient errors: 429 (rate limit), 500, 502, 503, 504, and network-level failures. Values below 1 are clamped to 1
ai_temperatureNo0.5Controls the randomness of the AI's output (0.0 = fully deterministic, 1.0 = most random). Lower values produce more consistent questions; higher values produce more varied output
api_keyNoAPI key for the provider. For github-models, leave empty to use github_token, or supply an instructor PAT to override it
azure_endpointNoAzure OpenAI endpoint URL (required for azure-openai)
num_questionsNo5Number of questions to generate (minimum 1, maximum 50). Values above 50 are automatically capped
include_answersNofalseWhen true, each question is immediately followed by its answer labelled Answer: in the student-facing report. The instructor repository (when instructor_repo_token is configured) always includes answers regardless of this setting. Answers are written in plain, everyday language and avoid technical jargon
include_patternsNoComma-separated globs for files to include
exclude_patternsNo(common non-code files)Comma-separated globs for files to exclude
output_fileNogrill-my-code.mdFilename for the output Markdown file
post_pr_commentNotruePost assessment as a PR comment
post_issueNofalseCreate a GitHub Issue with the assessment. Automatically assigned to the student who authored the head commit
post_discussionNofalseCreate a GitHub Discussion with the assessment. Discussions are enabled automatically if not already on
discussion_categoryNoAssessmentsDiscussion category name
instructor_repo_tokenNoPAT with repo scope and permission to create repositories in the same organisation. When provided, the action writes a private instructor-only assessment file (questions and answers) to a repository named {assignment-name}-grillmycode in the same organisation. The repository is created automatically on first run. The assignment name is resolved from the student repo's template_repository (GitHub Classroom), falling back to the source repo name. Leave empty to disable instructor repository delivery
additional_contextNoInstructor-specific instructions for this assignment. Injected into the system prompt and takes precedence over default behaviour. Supports multi-line instructions
assignment_contextNoComma-separated file glob(s) read from the repository and injected into the AI prompt before additional_context. Supported file types: plain text / source files (UTF-8), PDF (.pdf — text layer only), Microsoft Word (.doc/.docx — text only). If no files match, a workflow warning is emitted and the action continues without context. Example: "README.md, docs/brief.pdf, rubric.docx"
assignment_context_max_charsNo20000Maximum total characters read from all assignment_context files combined. Prevents large files from flooding the prompt. Values below 1 are clamped to 1
exclude_workflow_filesNotrueExclude .github/workflows/** files from the assessed diff. Set to "false" to include workflow files
keep_commentsNofalseWhen false (default), inline and block comments are stripped before sending code to the AI. Set to "true" to preserve comments
skip_initial_commitNotrueWhen true (default), pins the diff base to the first commit so starter/template files are excluded. When false, uses the empty tree as the base
skip_committersNogithub-classroom[bot],github-actions[bot]Comma-separated list of commit author names or email substrings. Leading bot commits after the base SHA are excluded from the diff. Set to '' to disable
base_shaNoOverride the base commit SHA
head_shaNoOverride the head commit SHA

Outputs

OutputDescription
output_filePath to the generated assessment Markdown file
questionsThe raw generated questions as a string
code_before_stripFull code content of all assessed files before comment stripping
code_after_stripFull code content of all assessed files after comment stripping

Using outputs in subsequent steps

- uses: NSCC-ITC-Assessment/GrillMyCode@v1
id: assess
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload assessment
uses: actions/upload-artifact@v4
with:
name: assessment
path: ${{ steps.assess.outputs.output_file }}

- name: Print questions
run: echo "${{ steps.assess.outputs.questions }}"