forked from kamilchodola/wait-for-workflow-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
60 lines (60 loc) · 1.97 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
55
56
57
58
59
60
name: "Wait for Workflow Action"
branding:
icon: "clock"
color: "blue"
description: "Waits for a specified workflow to complete before proceeding"
inputs:
GITHUB_TOKEN:
description: "GitHub token to access the repository"
required: true
workflow_id:
description: "ID of the workflow to wait for"
required: false
run_id:
description: "If provided will wait for workflow run with specified id"
required: false
max_wait_minutes:
description: "Maximum time script will wait to workflow run to be found in minutes"
required: false
default: "5"
interval:
description: "Interval in seconds which will be used for GitHub API calls"
required: false
default: "10"
timeout:
description: "Maximum time script will wait to workflow run to be finished"
required: false
default: "30"
minimum_time_offset:
description: "Minimum time offset in minutes between current time and workflow run creation time"
required: false
default: "15"
org_name:
description: "GitHub organization name"
required: true
repo_name:
description: "GitHub repository name"
required: true
ref:
description: "Branch reference (if empty, ref selected for trigger would be taken)"
required: false
default: ""
runs:
using: "composite"
steps:
- name: Set execute permissions for script
run: chmod +x ${{ github.action_path }}/scripts/wait-for-workflow.sh
shell: bash
- run: ${{ github.action_path }}/scripts/wait-for-workflow.sh
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
WORKFLOW_ID: ${{ inputs.workflow_id }}
RUN_ID: ${{ inputs.run_id }}
MAX_WAIT_MINUTES: ${{ inputs.max_wait_minutes }}
INTERVAL: ${{ inputs.interval }}
TIMEOUT: ${{ inputs.timeout }}
ORG_NAME: ${{ inputs.org_name }}
REPO_NAME: ${{ inputs.repo_name }}
REF: ${{ inputs.ref || github.ref }}
MINIMUM_TIME_OFFSET: ${{ inputs.minimum_time_offset }}