-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (42 loc) · 1.28 KB
/
workflow-run.yaml
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
name: Run
run-name: ${{ github.event.workflow.name }} on ${{ github.event.workflow_run.head_branch }}
on:
workflow_run:
types: [ 'completed' ]
workflows:
- Test
jobs:
fail:
name: Fail
runs-on: ubuntu-latest
steps:
- run: exit 1
test:
name: Check run?
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request'
steps:
- name: Env
run: env
- name: Event data
run: cat $GITHUB_EVENT_PATH
- name: Check run?
env:
TOKEN: ${{ github.token }}
SHA: ${{ github.event.workflow_run.head_sha }}
run: |
curl -v -X POST \
--header "authorization: token $TOKEN" \
--url https://api.github.com/repos/anomiex/testing/check-runs \
--data "$(jq --arg sha "$SHA" --arg url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" -n '{
"name": "Test check run",
"head_sha": $sha,
"details_url": $url,
"status": "in_progress",
"started_at": now | todateiso8601,
"output": {
"title": "Check run title",
"summary": "Check run summary",
"text": "Check run text",
},
}')"