Grade CloudSprints labs automatically via pull requests. No student tokens needed — the action identifies students by their Git commit email.
- Name your branch
grade/<lesson-token>(copy from CloudSprints UI) - Push your code and open a PR
- The action detects your email from the Git commit, fetches the lesson, runs validation commands, and submits for AI grading
- Results appear in the workflow log (and optionally as PR comments via the CloudSprints GitHub App)
Prerequisites: Your Git email must match the email you signed up with on CloudSprints.
Create .github/workflows/grade.yml:
name: CloudSprints Grader
on:
pull_request:
branches: [main]
jobs:
grade:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: morethancertified/sprintctl-action@v1
with:
api-key: ${{ secrets.CLOUDSPRINTS_API_KEY }}The CLOUDSPRINTS_API_KEY is a shared key that authenticates the GitHub Action to the CloudSprints API. It is not a per-student token.
- Get the API key from your CloudSprints admin
- In your GitHub repo → Settings → Secrets → Actions → New repository secret
- Name:
CLOUDSPRINTS_API_KEY, Value: the key
Copy the branch name from the lesson in CloudSprints:
git checkout -b grade/cm4ppz694200blze51ts1234# ... complete the lab tasks ...
git add .
git commit -m "completed lab"
git push origin grade/cm4ppz694200blze51ts1234
# Open a PR to mainThe grading action runs automatically. Check the Actions tab for results.
| Input | Required | Default | Description |
|---|---|---|---|
api-key |
✅ | — | CloudSprints API key (shared, set by instructor) |
api-url |
❌ | https://cloudsprints.com |
API base URL |
branch-prefix |
❌ | grade/ |
Branch prefix that triggers grading |
callback-url |
❌ | — | URL for GitHub App result reporting |
| Output | Description |
|---|---|
lesson-token |
Lesson token extracted from branch |
email |
Student email detected from Git commit |
passed |
Number of tasks passed |
failed |
Number of tasks failed |
total |
Total number of tasks |
status |
pass or fail |
results-json |
Full grading results as JSON |
Each lab gets its own branch. The workflow file stays the same:
main
├── grade/cm4ppz694200blze51ts1234 ← Lab 1
├── grade/cm5qqz694200blze51ts5678 ← Lab 2
└── grade/cm6rrz694200blze51ts9012 ← Lab 3
If a lab has starter code, download it into your branch:
git checkout -b grade/cm4ppz694200blze51ts1234
curl -sL https://cloudsprints.com/labs/k8s-pods-101/starter.tar.gz | tar xz --strip-components=1
git add .
git commit -m "add starter code"- uses: morethancertified/sprintctl-action@v1
id: grading
with:
api-key: ${{ secrets.CLOUDSPRINTS_API_KEY }}
- name: Custom summary
if: always()
run: |
echo "Score: ${{ steps.grading.outputs.passed }}/${{ steps.grading.outputs.total }}"
echo "Status: ${{ steps.grading.outputs.status }}"