-
Notifications
You must be signed in to change notification settings - Fork 4
86 lines (72 loc) · 2.67 KB
/
aoji-pr-target.yml
File metadata and controls
86 lines (72 loc) · 2.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: AOJI PR Target
on:
pull_request_target:
branches:
- main
types: [opened, labeled]
jobs:
aoji:
if: | # is a fork
github.event.pull_request.head.repo.full_name != github.repository &&
contains(github.event.pull_request.labels.*.name, 'aoji-safe')
name: Run AOJI
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 3
- 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.event.pull_request.head.sha }}
- name: Upload AOJI Report
uses: actions/upload-artifact@v2
with:
name: aoji-report
path: .github/aoji_report.md
if-no-files-found: error
- name: Check Judge Failure
id: check_aoji_fail
uses: andstor/file-existence-action@v1
with:
files: ".github/fail.aoji"
- name: Upload AOJI Fail Report
if: steps.check_aoji_fail.outputs.files_exists == 'true'
uses: actions/upload-artifact@v2
with:
name: aoji-fail-report
path: .github/fail.aoji
- uses: actions/checkout@v2
- name: Download AOJI Report
uses: actions/download-artifact@v2
with:
name: aoji-report
path: .github
- name: Download AOJI Fail Report
if: steps.check_aoji_fail.outputs.files_exists == 'true'
uses: actions/download-artifact@v2
with:
name: aoji-fail-report
path: .github
- name: Comment Report
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'
- run: |
gem install octokit
ruby ./.github/comment-pr.rb ${{ secrets.GITHUB_TOKEN }} ${{ github.event.pull_request.number }} ".github/aoji_report.md"
- name: Delete AOJI Reports
uses: geekyeggo/delete-artifact@v1
with:
name: |
aoji-report
aoji-fail-report
failOnError: false
- name: Raise CI Fail
if: steps.check_aoji_fail.outputs.files_exists == 'true'
run: exit 1