Skip to content

Commit 9ad36ef

Browse files
authored
Merge pull request #3 from code4policy/main
GitHub Classroom: Sync Assignment
2 parents 8606e15 + 2a3e7a3 commit 9ad36ef

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/classroom.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Just check for 5 commits on main :(
2+
name: Mozilla Website Autograder
3+
on:
4+
- push
5+
- workflow_dispatch
6+
- repository_dispatch
7+
permissions:
8+
contents: read
9+
actions: read
10+
checks: write
11+
jobs:
12+
run-autograding-tests:
13+
runs-on: ubuntu-latest
14+
if: github.actor != 'github-classroom[bot]'
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- name: Check commits
21+
id: check-commits
22+
uses: classroom-resources/autograding-command-grader@v1
23+
with:
24+
test-name: Check commits
25+
command: |
26+
REPO="${{ github.repository }}"
27+
REPO="${REPO##*/}"
28+
STUDENT="${REPO##*-}"
29+
COUNT=$(git log main --author="$STUDENT" --pretty=oneline | wc -l | tr -d ' ')
30+
echo "Student: $STUDENT"
31+
echo "Commit count on main: $COUNT"
32+
[ "$COUNT" -ge 5 ]
33+
timeout: 2
34+
max-score: 10
35+
- name: Autograding Reporter
36+
uses: classroom-resources/autograding-grading-reporter@v1
37+
env:
38+
CHECK-COMMITS_RESULTS: "${{steps.check-commits.outputs.result}}"
39+
with:
40+
runners: check-commits

0 commit comments

Comments
 (0)