Comments (3)
For XML substitution, currently we support only nodes "applicationSettings", "appSettings", "connectionStrings", "configSections"
When your attribute is key
or name
then value of value
attribute will be replaced.
If your XML is like below
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="Foo" value="Bar" />
</appSettings>
</configuration>
then your workflow should be like this
- uses: microsoft/variable-substitution@v1
with:
files: 'Web.config'
env:
Foo: "foo"
which will change xml like below:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="Foo" value="foo"/>
</appSettings>
</configuration>
if your xml is like below:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<machineKey validationKey="foo" decryptionKey="bar" />
</appSettings>
</configuration>
your workflow should be like this:
- uses: microsoft/variable-substitution@v1
with:
files: 'Web.config'
env:
validationKey: "bar"
and replaced xml will be
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<machineKey validationKey="bar" decryptionKey="bar"/>
</appSettings>
</configuration>
from variable-substitution.
I see. I think the hardcoded nodes is a bad design especially if we have custom nodes. We switched to using dotnet xdt
for xml transform instead. Thanks anyway!
from variable-substitution.
Thanks for the feedback. We will surely try to incorporate it.
from variable-substitution.
Related Issues (20)
- XML | Web.config | ##[error]Error: Failed to apply variable substitution HOT 2
- Yaml variable substitution Azure pipeline HOT 3
- Skipped updating file: .github/workflows/run_notebooks_mac.yml. But the variable does exists in yaml file HOT 1
- Using this action changes timestamp format in the yaml file HOT 4
- Changing the split character for variable substitution
- Substituting an int & multiple yaml files in one document
- YAML file mistakenly taken as XML format
- Planning to upgrade logo on GitHub Marketplace to Microsoft logo by end of May 2021 HOT 1
- @types/minimatch is declared in `dependencies` instead of `devDependencies`
- Failed to apply variable substitution HOT 2
- Only web.config XML files are supported :( HOT 1
- Replace value in list HOT 1
- Mistaken appsettings.json as YAML file HOT 3
- Value altered when substitude value in yaml HOT 1
- Target and replace XML connectionStrings node HOT 1
- Bug: Missing Replacement Action HOT 5
- Bump version to node.js 16 HOT 2
- Replacement suggestion
- Substitution fails when I give "**/test.json"
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 variable-substitution.