forked from alisw/AliPhysics
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (66 loc) · 2.09 KB
/
clean-test.yml
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
name: Clean PR checks
on:
workflow_dispatch:
inputs:
pr:
description: PR to be cleaned
required: true
checks:
description: Checks to be cleaned
required: true
default: 'build/AliPhysics/release,build/AliPhysics/root6'
owner:
description: Organization
required: true
default: 'alisw'
repo:
description: Repository
required: true
default: 'AliPhysics'
jobs:
cleanup_pr_checks:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install ali-bot
run: |
sudo apt-get update -y
sudo apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev
python -m pip install --upgrade pip
pip install git+https://github.com/alisw/ali-bot@master
- uses: octokit/[email protected]
id: get_last_commit_for_pr
with:
query: |
{
repository(owner: "${{ github.event.inputs.owner }}", name: "${{ github.event.inputs.repo }}") {
url
pullRequest(number:${{ github.event.inputs.pr }}) {
commits(last: 1) {
nodes {
commit {
oid
}
}
}
}
}
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup tests
run: |-
set -x
cat <<\EOF > results.json
${{ steps.get_last_commit_for_pr.outputs.data }}
EOF
COMMIT=$(jq -r '.repository.pullRequest.commits.nodes[].commit.oid' results.json)
echo $COMMIT
for check in `echo ${{ github.event.inputs.checks }} | tr , \\\\n`; do
set-github-status -c ${{ github.event.inputs.owner }}/${{ github.event.inputs.repo }}@$COMMIT -s $check/pending
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}