-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
52 lines (52 loc) · 1.62 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
name: Yampl
description: GitHub Action to invoke yampl during CI/CD.
inputs:
file:
description: Path to the file that should be patched.
required: true
vars:
description: List of values to replace in the provided file.
required: true
values:
description: "Deprecated: Use vars instead"
default: ""
commit_message:
description: If set, this action will invoke stefanzweifel/git-auto-commit-action with the given commit message.
default: ""
commit_branch:
description: Git branch name, where changes should be pushed too. Required if Action is used on the `pull_request` event
default: ${{ github.head_ref }}
yampl_version:
description: Yampl version to install
default: latest
runs:
using: composite
steps:
- name: Install Yampl
uses: clevyr/setup-yampl-action@v1
with:
version: ${{ inputs.yampl_version }}
- name: Patch file
shell: bash
env:
FILE: ${{ inputs.file }}
VARS: ${{ inputs.vars }}
VALUES: ${{ inputs.values }}
run: |
shopt -s globstar 2>/dev/null || true
opts=( --inplace )
if [[ -n "$VARS" ]]; then
opts+=( --var="$VARS" )
fi
if [[ -n "$VALUES" ]]; then
echo '::warning::yampl-action "values" input is deprecated, use "vars" instead.'
opts+=( --value="$VALUES" )
fi
set -x
yampl "${opts[@]}" $FILE
- name: Commit changes
if: inputs.commit_message
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ${{ inputs.commit_message }}
branch: ${{ inputs.commit_branch }}