Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-square

GitHub Action

GitHub Issue Parser

v2.0.2

GitHub Issue Parser

check-square

GitHub Issue Parser

Use this action to convert issues into a unified JSON structure

Installation

Copy and paste the following snippet into your .yml file.

              

- name: GitHub Issue Parser

uses: stefanbuck/[email protected]

Learn more about this action in stefanbuck/github-issue-parser

Choose a version

GitHub Issue Parser

Use this action to convert issues into a unified JSON structure.

Setup

- uses: stefanbuck/github-issue-parser@v2
  id: issue-parser
  with:
    template-path: .github/ISSUE_TEMPLATE/bug-report.yml

- run: echo '${{ steps.issue-parser.outputs.jsonString }}' > bug-details.json

template-path is optional and meant to be used with Issue Forms.

Example

Given an issue form

name: Bug
description: Something is broken

title: "Order Pizza"

body:
  - type: input
    id: contact
    attributes:
      label: Your contact details
    validations:
      required: true

  - type: input
    id: what_happened
    attributes:
      label: What happened?
    validations:
      required: true

  - type: input
    id: version
    attributes:
      label: Version
    validations:
      required: true

  - type: input
    id: browsers
    attributes:
      label: What browsers are you seeing the problem on?
    validations:
      required: true

  - type: checkboxes
    attributes:
      label: What else?
      options:
        - label: Never give up
        - label: Hot Dog is a Sandwich

And an issue body

### Your contact details

[email protected]

### What happened?

A bug happened!

### Version

1.0.0

### What browsers are you seeing the problem on?

Chrome, Safari

### What else?

- [x] Never give up
- [ ] Hot Dog is a Sandwich

The actions output will be

{
  "contact": "[email protected]",
  "what_happened": "A bug happened!",
  "version": "1.0.0",
  "browsers": "Chrome, Safari",
  "never_give_up": true,
  "hot_dog_is_a_sandwich": false
}

Want to learn more about this concept? Check out the Codeless Contributions with GitHub Issue Forms post on my blog.

Real-world examples

Basic example

Ever wanted to order a pizza from a GitHub Issue? In this basic example, the order is processed and appended to the README using this Action.

See workflow

Awesome list

The awesome-browser-extensions-for-github repository is using this Action to make it super easy to submit a new extension just by filling a new GitHub Issue. The workflow runs and turns the issue into a code contribution once the label merge has been added.

See workflow