-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
81 lines (78 loc) · 2.61 KB
/
action.yml
File metadata and controls
81 lines (78 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: PR Quiz
description:
A GitHub Action that uses AI to generate a quiz based on a pull request
author: dkamm
branding:
icon: cpu
color: blue
inputs:
github-token:
description: GitHub token for API access
required: true
openai-api-key:
description: OpenAI API key for API access
required: true
ngrok-authtoken:
description: The ngrok authtoken to use for the server hosting the quiz.
required: true
model:
description:
The model to use for generating the quiz. It must be a model that
supports structured outputs. Defaults to 'o4-mini'.
required: false
default: 'o4-mini'
lines-changed-threshold:
description:
The minimum number of lines changed required to create a quiz. This is to
prevent quizzes from being created for small pull requests.
required: false
default: '100'
time-limit-minutes:
description:
The time limit to complete the quiz in minutes. This prevents the action
from running indefinitely.
required: false
default: '10'
max-attempts:
description:
The maximum number of attempts to pass the quiz. A value of 0 means
unlimited attempts.
required: false
default: '3'
exclude-file-patterns:
description:
A list of file patterns to exclude from the quiz as a JSON-ified string.
required: false
default:
'["**/*-lock.json", "**/*-lock.yaml", "**/*.lock", "**/*.map",
"**/*.pb.*", "**/*_pb2.py", "**/*.generated.*", "**/*.auto.*"]'
system-prompt:
description:
Optional override for the system prompt. Be sure the specify that multiple
choice questions must be returned.
required: false
runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install external dependencies
run: npm install @ngrok/ngrok ejs express
shell: bash
working-directory: ${{ github.action_path }}
- name: Run action
run: npx node dist/index.cjs
shell: bash
working-directory: ${{ github.action_path }}
env:
INPUT_GITHUB_TOKEN: ${{ inputs.github-token }}
INPUT_OPENAI_API_KEY: ${{ inputs.openai-api-key }}
INPUT_NGROK_AUTHTOKEN: ${{ inputs.ngrok-authtoken }}
INPUT_LINES_CHANGED_THRESHOLD: ${{ inputs.lines-changed-threshold }}
INPUT_TIME_LIMIT_MINUTES: ${{ inputs.time-limit-minutes }}
INPUT_MAX_ATTEMPTS: ${{ inputs.max-attempts }}
INPUT_EXCLUDE_FILE_PATTERNS: ${{ inputs.exclude-file-patterns }}
INPUT_MODEL: ${{ inputs.model }}
INPUT_SYSTEM_PROMPT: ${{ inputs.system-prompt }}