Comments (2)
Hi @iamazeem ,
Thank you for the quick response and detailed explanation.
I reviewed your action's source code and figured out that it is really just a substring replacement. There is no processing of nested JSON values.
Anyway, thank you for the action.
Good luck!
from substitute-action.
Hi @askrinnik,
Thank you for creating this issue!
Actually, this action is not a drop-in replacement for https://github.com/microsoft/variable-substitution.
It performs substitution on any type of file, be it a JSON, YAML, or a simple plain text file i.e. it's file format agnostic.
As mentioned in the README, it works with Bash/shell variable syntax i.e. $VAR
or ${VAR}
.
Each instance of $VAR
or ${VAR}
will be substituted in the input-files
by its respective value (if available).
Only underscores are allowed in the variable names as other characters make a shell variable name invalid.
The validation stage does report on such issues.
So, for this sample appsettings.json
:
{
"EdgeSecrets.Databases.NetMeter.ConnectionString": "${PERFORMANCE_TESTS_DB_CONNECTION_STRING}"
}
or,
{
"EdgeSecrets": {
"Databases": {
"NetMeter": {
"ConnectionString": "${PERFORMANCE_TESTS_DB_CONNECTION_STRING}"
}
}
}
}
The following workflow step should perform the substitution:
- name: Setting Connection String
uses: microsoft/variable-substitution@v1
env:
PERFORMANCE_TESTS_DB_CONNECTION_STRING: ${{ secrets.PERFORMANCE_TESTS_DB_CONNECTION_STRING }}
with:
inputs-files: '${{ github.workspace }}/Edge.Web/appsettings.json'
Let me know if this works fine for your use case.
Apart from that, for format specific files such as JSON and YAML, you may simply use jq and yq respectively.
from substitute-action.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from substitute-action.