Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Adding SplitChar Support #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,35 @@ jobs:
build:
runs-on: windows-latest
steps:
- uses: microsoft/variable-substitution@v1
- uses: microsoft/variable-substitution@latest
with:
files: 'Application/*.json, Application/*.yaml, ./Application/SampleWebApplication/We*.config'
env:
Var1: "value1"
Var2.key1: "value2"
SECRET: ${{ secrets.SOME_SECRET }}

```
Define `splitChar` to change the character used to split the environment variable names for variable identification and substitution
```yaml
# .github/workflows/var-substitution.yml
on: [push]
name: variable substitution in json, xml, and yml files

jobs:
build:
runs-on: windows-latest
steps:
- uses: microsoft/variable-substitution@latest
with:
files: 'Application/*.json, Application/*.yaml, ./Application/SampleWebApplication/We*.config'
splitChar: '__'
env:
Var1: "value1"
Var2__key1: "value2"
Var3__key1__key2: "value3"
SECRET: ${{ secrets.SOME_SECRET }}

```
# Contributing

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
files:
description: 'comma separated list of XML/JSON/YAML files in which tokens are to be substituted. Files names must be specified relative to the folder-path.'
required: true
splitChar:
description: 'The character within the environment variables used to split the name for variable location. This defaults to `.`'
require: false
default: '.'
runs:
using: 'node12'
main: 'lib/variableSubstitution.js'
Loading