mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #1317] toJSON(github) fails in run: but works in env: #712
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#712
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kanaka on GitHub (Aug 25, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1317
Bug report info
Command used with act
Describe issue
The use of
${{ toJSON(github) }}works in anenv:section but not in arun:definition. Other contexts (job, steps, runner, etc) work in both places. It seems according to https://docs.github.com/en/actions/learn-github-actions/contexts#example-printing-context-information-to-the-log that the github context should work in arunblock too.Link to GitHub repository
No response
Workflow content
Relevant log output
Additional information
No response
@ChristopherHX commented on GitHub (Aug 25, 2022):
I removed the bug label, because this works as designed like actions/runner.
Both json and and your echo statement use
"quotes, this allows script injection and causes a bash syntax error.If you use single quotes, you can echo more json objects unless they contain
'quotes. All json objects contains"quotes.@kanaka commented on GitHub (Aug 25, 2022):
Interesting, this must have been changed in github enterprise 3.6. Thanks for following up.
@ChristopherHX commented on GitHub (Aug 26, 2022):
No, nothing changed in this area since 2019 depending on the content of the github event it partially works.
I guess this modified workflow works, but the
"are gone.In azure devops some people come to the conclusion converttojson outputs invalid json, due to script injection and missing quotes.