-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.73 KB
/
generate-code.yml
File metadata and controls
52 lines (46 loc) · 1.73 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
name: Generate Achievement Code
on:
repository_dispatch:
types: [generate-code]
permissions:
contents: write
pages: write
id-token: write
jobs:
generate:
runs-on: self-hosted
timeout-minutes: 5
defaults:
run:
shell: cmd
steps:
- name: Checkout main branch
uses: actions/checkout@v6
- name: Generate achievement code
env:
COURSE_NUMBER: ${{ github.event.client_payload.courseNumber }}
COURSE_URL: ${{ github.event.client_payload.courseUrl }}
STUDENTS: ${{ github.event.client_payload.students }}
REQUEST_ID: ${{ github.event.client_payload.requestId }}
STORAGE_STATE_PATH: C:/Users/ADMIN/Desktop/microsoftcert/webapp/data/storage_state.json
# Run auto re-login headed — matches the reliable local login and
# avoids Microsoft's headless bot-blocking (runner is an interactive desktop).
LOGIN_HEADLESS: "0"
run: python .github/scripts/generate_code_action.py
- name: Upload debug screenshots
if: always()
uses: actions/upload-artifact@v7
with:
name: debug-screenshots
path: ${{ runner.temp }}/debug-*.png
if-no-files-found: ignore
retention-days: 3
- name: Publish result to main branch
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if not exist webapp\results mkdir webapp\results
copy "%TEMP%\result.json" "webapp\results\${{ github.event.client_payload.requestId }}.json"
git add -f webapp/results/
git commit -m "result: ${{ github.event.client_payload.requestId }}"
git push