-
Notifications
You must be signed in to change notification settings - Fork 16
/
action.yml
54 lines (54 loc) · 2.33 KB
/
action.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
name: 'Organization workflow action'
description: 'Action to register organization workflow'
branding:
icon: 'check-circle'
color: 'white'
inputs:
run_id:
description: 'ID of workflow run (provided via GitHub syntax `github.run_id`)'
required: true
name:
description: 'Name of check (Use `github.workflow` to use the name of the workflow)'
required: true
callback_url:
description: 'Callback url for register call (provided by GitHub app via `github.event.client_payload.callback_url`)'
required: true
sha:
description: 'Sha of original commit (provided by GitHub app via `github.event.client_payload.sha`)'
required: true
branch:
description: 'branch of original commit (provided by GitHub app via `github.event.client_payload.branch`)'
required: true
repository_owner:
description: 'repositroy_owner of original commit (provided by GitHub app via `github.event.client_payload.repository.owner`)'
required: true
repository_name:
description: 'repositroy_name of original commit (provided by GitHub app via `github.event.client_payload.repository.name`)'
required: true
event_type:
description: 'event_type triggered by the GitHub App (provided by GitHub app via `github.event.client_payload.event_type`)'
required: true
enforce:
description: 'Enforce [required status check](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/enabling-required-status-checks)'
required: false
default: false
enforce_admin:
description: 'Enforce [required status check](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/enabling-required-status-checks) for admins'
required: false
default: false
runs:
using: "composite"
steps:
- run: |
curl -G \
"${{ inputs.callback_url }}" \
-d run_id=${{ inputs.run_id }} \
-d sha=${{ inputs.sha }} \
-d branch=${{ inputs.branch }} \
-d event_type=${{ inputs.event_type }} \
--data-urlencode "repository_owner=${{ inputs.repository_owner }}" \
--data-urlencode "repository_name=${{ inputs.repository_name }}" \
-d enforce=${{ inputs.enforce }} \
-d enforce_admin=${{ inputs.enforce_admin }} \
--data-urlencode "name=${{ env.name || github.workflow }}"
shell: bash