-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
50 lines (50 loc) · 1.74 KB
/
action.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
46
47
48
49
50
name: Time Window Validator
description: This action validates a timestamp against allowed and/or blocked time windows.
author: Paul Landázuri
branding:
icon: clock
color: green
outputs:
error:
description: Any error returned by the time window validator.
is_valid:
description: Boolean result of the time window validator.
message:
description: Message returned by the time window validator.
timestamp:
description: The validated Unix timestamp.
result:
description: Full JSON result.
inputs:
allowed:
description: The allowed time windows in YAML.
required: false
blocked:
description: The blocked time windows in YAML.
required: false
commit-message:
description: The commit message used to check the regular expression against. By default `github.event.head_commit..message || github.event.workflow_run.head_commit.message`
required: false
default: ${{ github.event.head_commit.message || github.event.workflow_run.head_commit.message }}
force-valid-regexp:
description: A regular expression to check against the commit message. If matched, this action always returns `is_valid=true`. By default, `force-time-window`.
required: false
default: force\-time\-window
timestamp:
description: Unix timestamp (in seconds) to validate the time windows against. By default, this is the current timestamp.
required: false
default: '0'
runs:
using: docker
image: docker://ghcr.io/landazuripaul/time-window-validator:v1.0.1
args:
- -allowed
- ${{ inputs.allowed }}
- -blocked
- ${{ inputs.blocked }}
- -commit_message
- ${{ inputs.commit-message }}
- -force_valid_regexp
- ${{ inputs.force-valid-regexp }}
- -timestamp
- ${{ inputs.timestamp }}