-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (47 loc) · 1.67 KB
/
aoji-commit.yml
File metadata and controls
56 lines (47 loc) · 1.67 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
name: AOJI Commit
on:
push:
branches:
- main
jobs:
aoji:
name: Run AOJI
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Run AOJI
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
./.github/aoji.sh ${{ secrets.AOJ_ID }} ${{ secrets.AOJ_PASSWD }} ${{ github.sha }}
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v1
with:
files: ".github/aoji_report.md"
- id: get-comment-body
if: steps.check_files.outputs.files_exists == 'true'
run: |
body=$(cat .github/aoji_report.md)
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo ::set-output name=body::"$body"
- name: Comment Report
if: steps.check_files.outputs.files_exists == 'true'
uses: peter-evans/commit-comment@v1
with:
body: ${{ steps.get-comment-body.outputs.body }}
- name: Check Judge Failure
id: check_aoji_fail
uses: andstor/file-existence-action@v1
with:
files: ".github/fail.aoji"
- name: Raise CI Fail
if: steps.check_aoji_fail.outputs.files_exists == 'true'
run: exit 1