forked from grafana/wait-for-github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
98 lines (93 loc) · 3.16 KB
/
action.yml
File metadata and controls
98 lines (93 loc) · 3.16 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
87
88
89
90
91
92
93
94
95
96
97
98
name: Wait for GitHub
description: Wait for things to happen on GitHub
inputs:
token:
description: "GitHub token"
required: false
default: ${{ github.token }}
app-id:
description: "GitHub App ID"
required: false
app-installation-id:
description: "GitHub App installation ID"
required: false
app-private-key:
description: "GitHub App private key"
required: false
exclude-checks:
description: 'The comma-separated names of the checks to exclude statuses of. Only used when wait-for is "ci"'
required: false
timeout:
description: "Timeout in golang duration format"
required: false
default: 5m
interval:
description: "Recheck interval (poll this often) in golang duration format"
required: false
default: 30s
wait-for:
description: 'What to wait for. Valid values: "ci" (wait for CI to finish), "pr" (wait for PR to be merged)'
required: true
owner:
description: "GitHub repo owner"
required: false
default: ${{ github.repository_owner }}
repo:
description: "GitHub repo name"
required: false
default: ${{ github.event.repository.name }}
ref:
description: "Git ref to check"
required: true
checks-to-wait-for:
description: 'The comma-separated names of the checks to wait for. Only used when wait-for is "ci"'
required: false
action-retries:
description: 'Number of times to retry failed GitHub Actions before failing. Only used when wait-for is "pr"'
required: false
default: "0"
runs:
using: composite
steps:
- name: Check repository out
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
env:
action_repo: ${{ github.action_repository }}
action_ref: ${{ github.action_ref }}
with:
path: ${{ github.workspace }}/action-checkout
repository: ${{ env.action_repo }}
ref: ${{ env.action_ref }}
- name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: ${{ github.workspace }}/action-checkout/go.mod
- name: Run
shell: sh
env:
GITHUB_TOKEN: ${{ inputs.token }}
GITHUB_CI_CHECKS: ${{ inputs.checks-to-wait-for }}
GITHUB_CI_EXCLUDE: ${{ inputs.exclude-checks }}
GITHUB_ACTION_RETRIES: ${{ inputs.action-retries }}
GITHUB_APP_ID: ${{ inputs.app-id }}
GITHUB_APP_INSTALLATION_ID: ${{ inputs.app-installation-id }}
GITHUB_APP_PRIVATE_KEY: ${{ inputs.app-private-key }}
INPUT_REF: ${{ inputs.ref }}
INPUT_REPO: ${{ inputs.repo }}
INPUT_OWNER: ${{ inputs.owner }}
INPUT_TIMEOUT: ${{ inputs.timeout }}
INPUT_INTERVAL: ${{ inputs.interval }}
INPUT_WAIT_FOR: ${{ inputs.wait-for }}
run: |
cd "${{ github.workspace }}/action-checkout"
go run github.com/grafana/wait-for-github/cmd/wait-for-github \
--log-level \
debug \
--timeout \
"${INPUT_TIMEOUT}" \
--recheck-interval \
"${INPUT_INTERVAL}" \
"${INPUT_WAIT_FOR}" \
"${INPUT_OWNER}" \
"${INPUT_REPO}" \
"${INPUT_REF}"