-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
47 lines (47 loc) · 1.83 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
name: 'grandcentrix Actions Validator'
author: 'grandcentrix'
description: 'Simple way to validate and run (i.e. simulate the run of) GitHub Actions Workflow files'
branding:
icon: 'eye'
color: 'white'
inputs:
file:
description: 'Workflow file to use'
required: true
config:
description: 'Config file to override defaults'
required: false
dry_run:
description: 'In dry run no shell scripts are executed'
required: false
default: 'true'
fail_fast:
description: 'Fail as soon as there is an unknown variable or undeclared action input is used'
required: false
default: 'false'
prepopulate:
description: 'Prepopulate some of the default vars and environment vars - you can still override them'
required: false
default: 'true'
vars:
description: 'Sets an variable - e.g. foo=bar, separated by whitespace'
required: false
runs:
using: "composite"
steps:
- name: Prepare configuration
id: config
run: |
config="$( [[ '${{ inputs.config }}' != '' ]] && echo '--config ${{ inputs.config }}' || echo '' )"
dry_run="$( [[ ${{ inputs.dry_run }} == true ]] && echo '-d' || echo '' )"
fail_fast="$( [[ ${{ inputs.fail_fast }} == true ]] && echo '-f' || echo '' )"
prepopulate="$( [[ ${{ inputs.prepopulate }} == true ]] && echo '-p' || echo '' )"
parameters="$dry_run $fail_fast $prepopulate $config ${{ inputs.file }} ${{ inputs.vars }}"
echo "::set-output name=parameters::$parameters"
binary="$( [[ ${{ runner.os }} == 'macOS' ]] && echo 'acsim-macos-latest' || echo 'acsim-ubuntu-latest' )"
echo "::set-output name=binary::$binary"
shell: bash
- name: Run Actions Simulator
run: |
${{ github.action_path }}/${{ steps.config.outputs.binary }} ${{ steps.config.outputs.parameters }}
shell: bash