Skip to content
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

Available template variables. #86

Closed
konstruktoid opened this issue Feb 24, 2021 · 2 comments
Closed

Available template variables. #86

konstruktoid opened this issue Feb 24, 2021 · 2 comments

Comments

@konstruktoid
Copy link

Hi,
according to the README we can set different variables, e.g. Someone just pushed, oh no! Here's who did it: {{ payload.sender.login }}., and the list of available template variables is present at https://github.com/JasonEtco/actions-toolkit#toolscontext.

However, payload.* isn't anywhere to be found on https://github.com/JasonEtco/actions-toolkit and when using {{ tools.context.actor }}: {{ tools.context.sha }} no information is added to the created issue.

See konstruktoid/ansible-role-hardening#48 and https://github.com/konstruktoid/ansible-role-hardening/runs/1965196550?check_suite_focus=true#step:4:1

@njimenezotto
Copy link

njimenezotto commented Jun 9, 2021

I can confirm this behavior. I tried to use {{ tools.context.actor }} or {{ tools.context.sha }} but they are empty.

@JasonEtco
Copy link
Owner

I don't think the documentation is very clear; tools.context.payload is available from actions-toolkit, and so becomes available in your issue templates as just {{ payload }}. So similarly, you'd have {{ actor }} and {{ sha }}. You can see an example of using tools.context.action as {{ action }} in this test / this fixture.

PRs welcome for any doc improvements, but I'll go ahead and close this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants