-
-
Notifications
You must be signed in to change notification settings - Fork 371
46 lines (44 loc) · 1.63 KB
/
draft-ci.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
name: Draft CI
permissions: write-all
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- ready_for_review
jobs:
run:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Debug Echos
run: |
echo ${{ github.event.action }}
echo ${{ github.event.action == 'ready_for_review' }}
echo "${{ github.event.pull_request.head.repo.html_url }}/commits/${{github.event.pull_request.head.ref}}"
- name: Create status
run: |
curl --request POST \
--url ${{ github.event.pull_request.statuses_url }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "${{
(github.event.action == 'ready_for_review' || github.event.pull_request.draft == false)
&& 'success'
|| 'pending'
}}",
"context": "Draft CI / link",
"target_url": '${{
(github.event.action == 'ready_for_review' || github.event.pull_request.draft == false)
&& null
|| github.event.pull_request.head.repo.html_url + '/commits/' + github.event.pull_request.head.ref
}}',
"description": "${{
(github.event.action == 'ready_for_review' || github.event.pull_request.draft == false)
&& 'PR is ready for review, running CI in Mill repo'
|| 'use CI on your repo fork (link on right) until this PR is ready for review'
}}"
}' \
--fail-with-body