-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False Positive for Object Element Dereference #66
Comments
We are seeing the same thing here with this expression:
|
Thank you for reporting this. It looks a bug of actionlint. |
https://docs.github.com/en/actions/learn-github-actions/expressions#object-filters The document only mentions arrays as target of object filtering. So I thought the syntax was only for arrays when I implemented the type check. I think it was incorrect. |
Indeed; I noticed this as well when trying to find a link that would prove the syntax was supported and was pleasantly surprised that it was when I first tried it. I filed the issue linked above with GitHub to enhance their documentation accordingly. |
I tried - run: |
echo '${{ toJSON(fromJSON(env.JSON).*.foo) }}'
env:
JSON: '{"a": {"foo": "from a"}, "b": {"foo": "from b"}}' and confirmed output
https://github.com/rhysd/actionlint/runs/4136626284?check_suite_focus=true |
With cabbf84, |
The fix was released as v1.6.7 |
I can confirm that this fix is working for us. Thank you! |
Actionlint knows about array element dereferences, but not object element dereferences. For example, GitHub Actions supports the syntax
${{ join(needs.*.result, ' ') }}
as documented in slack-templates' README despite the fact that needs is not an array. Actionlint 1.6.6 yields an error message of the following form:Thank you for creating Actionlint! It's quite nice to have a super easy way to check whether an action has syntax errors without wasting build credits.
The text was updated successfully, but these errors were encountered: