Could I get issue title in Github actions by environment variables? #26715
-
Hi I’m trying to get issue title to use it to create issue clone on an another service. If it’s possible I’d like to get issue title in yml like getting branch name ? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hi @KouWakai |
Beta Was this translation helpful? Give feedback.
-
Depending on the event, it’s possible that what you want is available in the event objects which can be mapped to environment variables using You could try using
Contexts - GitHub DocsYou can access context information in workflows and actions. |
Beta Was this translation helpful? Give feedback.
-
Yes, @jsoref is right there. It’s not exactly env var and not for all GH events, but in this way you could access some context for few events. If to use events eg @KouWakai you can check this Get contents/body of issue in action as well |
Beta Was this translation helpful? Give feedback.
-
This one is self resolved. There is no way to get issue title like I asked. We could get title from payload which comes from like this: const github = require(’@actions/github’);
|
Beta Was this translation helpful? Give feedback.
-
Thank you for helping me out:pray: I couldn’t see reply yesterday for some reason(maybe the replies are meant to be awaiting for approval?) I’ll check |
Beta Was this translation helpful? Give feedback.
Yes, @jsoref is right there.
It’s not exactly env var and not for all GH events, but in this way you could access some context for few events.
If to use events eg
issues
Events that trigger workflows - GitHub Docs orissue_comment
Events that trigger workflows - GitHub Docs some information will be inside payload, for example forissues
Webhook events and payloads - GitHub Docs.Then inside
${{ github.event.issue.title }}
will be title of issue that triggered event.@KouWakai you can check this Get contents/body of issue in action as well