Comments (6)
That works.
Thanks,
David
from stepci.
Thanks for bug report, I'll look into it in a minute
from stepci.
Ok, so the bug has something to do with templating
from stepci.
So, this example works:
version: "1.1"
name: Basic Auth
env:
auth: aGVsbG86d29ybGQ=
tests:
example:
steps:
- name: Basic Auth
http:
url: https://httpbin.org/basic-auth/hello/world
method: GET
headers:
Authorization: Basic {{env.auth}}
check:
status: 200
This should work fine too:
headers:
Authorization: Bearer {{secrets.token}}
from stepci.
I have investigated the issue
turns out, YAML does some quirks when {{ }}
is not in a string
entering
{{test}}
produces:
{
"{\"test\"=>nil}": null
}
Try yourself: https://www.json2yaml.com
To fix the issue you have to wrap it in quotes, like that:
version: "1.1"
name: Basic Auth
env:
username: hello
password: world
tests:
example:
steps:
- name: Basic Auth
http:
url: https://httpbin.org/basic-auth/hello/world
method: GET
auth:
basic:
username: "{{ env.username }}"
password: "{{ env.password }}"
check:
status: 200
As this is a bit counterintuitive, I'll change the templating syntax to use ${{ }}
instead (like GitHub Actions)
I'll close the issue, as this is not a bug with Step CI per se
Thanks a lot for reporting though 🙏
from stepci.
Update: I have changed the templating syntax, you now have to use ${{ }}
for templates
from stepci.
Related Issues (20)
- Exporting metrics to JUnit
- Exporting metrics to Prometheus
- Exporting metrics to JSON
- Exporting metrics to HTML HOT 2
- Improve gRPC Integration
- (Docs) Testing SOAP APIs
- (Docs) Reference CO2.js in CO2 Testing article
- DNS, ping, trace route test type
- Allow referencing credentials in templates instead of `$ref`
- Full support for `$ref` across the whole file
- [Bug]: Check "Location" does not check properly HOT 8
- [Bug]: Int caputres are resent as strings / YAML parsing capabilities HOT 4
- [Bug]: trpc mutation procedures do not receive arguments from test. HOT 2
- Components refs do not work in include
- [Bug]: only the leading digit of the parameter value is sent HOT 2
- [Bug]: Support 3.1 openapi
- [Feature Request] Reuse test ref'd via JSON pointer URL inside other tests HOT 1
- [Bug]: Include statement in already included file does not work. HOT 1
- Document SSE step type
- JSON Schema for Workflow
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 stepci.