Skip to content

Get contents/body of issue in action #25486

Closed Answered by BrightRan
mat-0 asked this question in Actions
Discussion options

You must be logged in to vote

@MatBenfield,

When the workflow is triggered by the events related to issue (issues or issue_comment), from the github context of the workflow run you can get the details of the issue via the object “github.event.issue”.
For example:

  • github.event.issue.title - - the title of the issue.
  • github.event.issue.body - - the body (or description) of the issue, it is the first comment when creating the issue.

A simple workflow example:

on: issues

jobs:
job1:
runs-on: ubuntu-latest
steps:
- name: View issue information
run: |
echo "Issue title: ${{ github.event.issue.title }}"
echo "Issue body: ${{ github.event.issue.body }}"

You also can print the whole github context to the logs to view more …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants