Comments (5)
I commented to the original issue.
from actionlint.
Thank you for the clarification. Then I'm closing this issue.
from actionlint.
I didn't know this behavior. It looks nice if actionlint can catch it. I need to check how go-yaml parses the syntax. Can you provide some sample YAML input which should cause the error? I could find an example in the issue description.
from actionlint.
I tried this on my test repository but it looks that >-
is supported.
Workflow was:
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: >-
echo foo
bar
And echo foo bar
seemed to be executed correctly.
Am I misunderstanding anything?
from actionlint.
Interesting! I had a PR that would use this in a workflow on WordPress/openverse, and another maintainer had run into an issue before with >
, and advised me to avoid it, including the link to the GitHub actions issue I shared in this issue's description.
I'm realising now that I didn't actually get a chance to try the workflow I was modifying (it only runs when we publish a release, so not in a PR), and I did not look deeply into the issue the other maintainer had. It seems like the other issue may have been unrelated to the >
usage (it wasn't even >-
).
Anyway, I'm playing around now with the original failure that the other maintainer ran into, and it turns out it has to do with the leading whitespace on the other lines of the block, which you've left out.
I think GitHub's YAML parser works perfectly, the Openverse project and the person who opened actions/runner#418, just didn't understand (or expect) how YAML parses leading whitespace on lines inside a >
block.
Compare these two: without leading whitespace on the second line and with leading whitespace. I, and I bet everyone else having this issue, incorrectly assumed the whitespace would be treated just as spaces. However, the YAML spec (somewhat inexplicably, if you ask me, but 🤷), thinks there should be a newline in those cases.
Here's the relevant section in the YAML spec: https://yaml.org/spec/1.2.2/#block-folding
folding does not apply to line breaks surrounding text lines that contain leading white space
Meaning, newlines are inserted when there is leading whitespace.
So, while I wish this was something actionlint could solve, I don't think it's within actionlint's scope. It's really better put to a YAML linter to warn you that this feature might have some pitfalls. I'm not confident either way, but I think you'd be fine to close this issue as out of scope.
Thanks for taking the time to look at this!
from actionlint.
Related Issues (20)
- Action lint fails occasionally - fatal error: concurrent map writes HOT 6
- No labels for Larger Hosted Runners HOT 2
- Actionlint does not alert on a mis-terminated expression for `if`
- Warning if explicit shell is not set HOT 2
- Support glob/regex patterns for self hosted runner labels configuration HOT 1
- Support validation of the inputs passed in the with block
- [BUG] `timeout-minutes` should allow expressions (but it demands `floats`) HOT 2
- Feature Request: checking workflow inputs for Untrusted input HOT 1
- Support tsc to check actions/github-script steps HOT 1
- Feature request: Require job name
- feature request: detect invalid reference to a workflow file HOT 1
- support macOS-14 runs on HOT 3
- Feature request: Allow usage of .shellcheckrc HOT 6
- Release recent changes HOT 1
- Composite actions support? HOT 4
- False Positive On fromJson in services Mapping Nodes
- Failed on "google-github-actions/get-secretmanager-secrets" HOT 7
- v1.6.27 Actionlint do not recognising outputs from google-github-actions/get-secretmanager-secrets@v2 HOT 1
- Seems like actionlint lack support to detect when we call reusable workflow in the main workflow. HOT 2
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 actionlint.