-
Notifications
You must be signed in to change notification settings - Fork 0
/
action-composite.yaml
52 lines (43 loc) · 2.95 KB
/
action-composite.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
51
52
# this is an example metadata file for a GitHub Composite Action
# the file must be named 'action.yaml' or 'action.yml'
# source: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions
# source: https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
name: 'Hello World' # name of your Composite Action. required
author: 'Nathan Nellans' # author of your Composite Action. optional
description: 'Greet someone' # description of your Composite Action. required
branding: # branding is shown next to your action name in GitHub Marketplace. optional
color: 'green' # options are: white, yellow, blue, green, orange, red, purple, gray-dark
icon: 'globe' # pick an option from https://feathericons.com, however some options are omitted, read the docs
inputs: # specifies input parameters that your Composite Action expects to receive when being called
who-to-greet: # id of this input parameter. required. must start with a letter or underscore. can only contain letters, numbers, dashes, or underscores. recommend using lowercase input ids
description: 'Who to greet' # description of this input parameter. required
required: true # specifies if your Composite Action requires a value for this input parameter. optional
default: 'World' # default value to use if a value is not supplied when called. optional
deprecationMessage: 'Some Warning Message' # use this to warn users that the input is deprecated. optional
runs:
using: 'composite' # must be set to composite
steps: # the steps that you plan to run in this Composite Action
- id: # id of the step, so you can reference this step later. optional
name: # name of the step. optional
if: # step conditions, ${{ ... }} can optionally be used to enclose your condition. optional
env: # step-level variables. optional
KEY: value
KEY: value
working-directory: # only for 'run' steps, sets the current working directory. optional
run: echo Hello ${{ inputs.who-to-greet }}. # single-line command to run
shell: bash # required for a 'run' step. options are: bash, pwsh, python, sh, cmd, powershell
- id: random-number-generator
run: echo "random-number=$(echo $RANDOM)" >> $GITHUB_OUTPUT
shell: bash
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash
- run: goodbye.sh
shell: bash
- uses: actions/hello_world@main # run a GitHub Action step
with: # parameters to pass to the action, must match what is defined in the action
key: value
key: value
outputs:
random-number: # id of this output parameter. required. must start with a letter or underscore. can only contain letters, numbers, dashes, or underscores
description: 'Random number' # description of this output parameter. required
value: ${{ steps.random-number-generator.outputs.random-number }} # value of this output parameter. required. can be set to a string or an expression