-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
108 lines (88 loc) · 3.45 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
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
99
100
101
102
103
104
105
106
107
108
name: 'ZyAction: Glob Match'
description: A GitHub Action for matching `glob` patterns.
author: Florian Bernd
branding:
icon: filter
color: black
inputs:
working-directory:
description: >
The working-directory for the action.
Defaults to the repository root directory (`github.workspace`).
When working on the file system, patterns and matches are considered relative to the
specified working directory. If the `pipe` input is used, the pipe command will be executed
in the current `working-directory`. This input has no effect if the `values` input is set.
The working directory will as well be included in the `pipe` output, if `return-pipe` is
enabled.
type: string
required: false
default: ${{ github.workspace }}
pattern:
description: >
One or more file, path, or placeholder patterns that describe which items to match.
Supports multiline strings.
type: string
required: true
default: ''
values:
description: >
An optional list of values to be matched (separated by line breaks).
The action operates on the file system if neither the `values`-, nor the `pipe`-input
is set.
This input must be used mutually exclusive with the `pipe` input.
type: string
required: false
default: ''
pipe:
description: >
An optional pipe input from which the input values are to be read.
This must be set to a valid shell command line (bash) that can be used for piping. The
command must output to `stdout` and separate the individual values by line breaks.
WARNING:
The command passed to this input will be evaluated and should not come from untrusted
sources.
The pipe command is executed in the current `working-directory` by default. If the pipe
command is to be executed in another working directory, make sure to properly insert a
directory change command.
The action operates on the file system if neither the `values`-, nor the `pipe`-input
is set.
This input must be used mutually exclusive with the `values` input.
type: string
required: false
default: ''
return-pipe:
description: >
Enable this option to return a shell (bash) command in the `pipe` output that can be
used for piping.
The output command must be `eval`ed to return the results. It can also be passed to
other actions that support a `pipe` input.
The `matches` output will not be populated if this option is enabled.
type: boolean
required: false
default: false
outputs:
matches:
description: >
A list of all matching elements, delimited by newlines or spaces (if the `quote` option is
used).
This output is only available if the `return-pipe` option is not enabled.
value: ${{ steps.glob.outputs.matches }}
pipe:
description: >
A shell (bash) command which can be used for piping.
This output is only available if the `return-pipe` option is enabled.
value: ${{ steps.glob.outputs.pipe }}
runs:
using: composite
steps:
- name: Glob Match
id: glob
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
INPUT_PATTERN: ${{ inputs.pattern }}
INPUT_VALUES: ${{ inputs.values }}
INPUT_PIPE: ${{ inputs.pipe }}
INPUT_RETURN_PIPE: ${{ inputs.return-pipe != 'false' && 'true' || 'false' }}
run: |
"${{ github.action_path }}/entrypoint.sh"