Skip to content

Commit ce935e9

Browse files
authored
make autograder handle duplicate assignment repos + usernames w/ dashes
1 parent 9ad36ef commit ce935e9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/classroom.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ jobs:
2525
command: |
2626
REPO="${{ github.repository }}"
2727
REPO="${REPO##*/}"
28-
STUDENT="${REPO##*-}"
28+
29+
# Strip trailing -<number> only
30+
STUDENT="$(echo "$REPO" | sed -E 's/-[0-9]+$//')"
31+
2932
COUNT=$(git log main --author="$STUDENT" --pretty=oneline | wc -l | tr -d ' ')
3033
echo "Student: $STUDENT"
3134
echo "Commit count on main: $COUNT"
@@ -37,4 +40,4 @@ jobs:
3740
env:
3841
CHECK-COMMITS_RESULTS: "${{steps.check-commits.outputs.result}}"
3942
with:
40-
runners: check-commits
43+
runners: check-commits

0 commit comments

Comments
 (0)