-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
30 lines (29 loc) · 970 Bytes
/
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
name: inline-envsubst
description: This is an action to run envsubst inline in a set of files. Allows limiting patterns and does not use Docker.
author: Dominic Watson
branding:
icon: 'repeat'
color: 'orange'
inputs:
files:
description: One or more files, separated by a space, that will have envsubst performed on them.
required: true
patterns:
description: Restrict the substitution to a strict set of patterns, rather than attempting to match any patterns found. Patterns separated by a space.
required: false
runs:
using: 'composite'
steps:
- run: |
for FILE in $FILES; do
if [[ -n $PATTERNS ]] ; then
envsubst "${PATTERNS}" < $FILE > /tmp/envsubst || exit 1
else
envsubst < $FILE > /tmp/envsubst || exit 1
fi
mv /tmp/envsubst $FILE || exit 1
done
shell: bash
env:
FILES: ${{ inputs.files }}
PATTERNS: ${{ inputs.patterns }}