This action allows you to substitute environment variables in files.
Will replace all
deployment.json (BEFORE)
{
"version": "${VERSION}",
"instance": "$INSTANCE"
}
ACTION
- uses: danielr1996/envsubst-action@1.0.0
env:
VERSION: 1.2.3
INSTANCE: staging
with:
files: |
deployment.json
deployment.json (AFTER)
{
"version": "1.2.3",
"instance": "staging"
}
ACTION
- uses: danielr1996/envsubst-action@1.0.0
env:
VERSION: 1.2.3
INSTANCE: staging
with:
files: |
deployment.json
test.json
apps/Dockerfile
by listing varaibles you want to have replaced you can override default behaviour of envsubst which does replace all found
ACTION
- uses: danielr1996/envsubst-action@1.0.0
env:
VERSION: 1.2.3
INSTANCE: staging
USER: devops
with:
variables: |
$VERSION
$INSTANCE
files: |
deployment.json
test.json
apps/Dockerfile