Skip to content
align-left

GitHub Action

Extract Issue Template Fields

v1.0.3 Latest version

Extract Issue Template Fields

align-left

Extract Issue Template Fields

Extract metadata and body from issue template markdown

Installation

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

              

- name: Extract Issue Template Fields

uses: imjohnbo/[email protected]

Learn more about this action in imjohnbo/extract-issue-template-fields

Choose a version

Extract Issue Template Fields

Extract issue template fields with GitHub Actions

About

GitHub issue templates are great. You can use them to standardize issue contributor experience. This action lets you pull the body, title, labels, and assignees from an issue template for use with downstream actions or applications.

Pairs nicely with issue-bot 🦾.

Usage

On its own

on:
  workflow_dispatch

name: Extract template fields

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    # Get the title, labels, assignees, and body of the issue template at the path,
    # .github/ISSUE_TEMPLATE/my_template.md, if available.
    - uses: imjohnbo/extract-issue-template-fields@v1
      id: extract
      with:
        path: .github/ISSUE_TEMPLATE/my_template.md

    # Log outputs of previous step
    - run: |-
        echo $ASSIGNEES $LABELS $TITLE $BODY
      env:
        ASSIGNEES: ${{ steps.extract.outputs.assignees }}
        LABELS: ${{ steps.extract.outputs.labels }}
        TITLE: ${{ steps.extract.outputs.title }}
        BODY: ${{ steps.extract.outputs.body }}

With issue-bot

For more, see https://github.com/imjohnbo/issue-bot.

on:
  schedule:
  # On the first day of every month. See more at https://crontab.guru/#0_0_1_*_*.
  - cron: 0 0 1 * * 

name: Create scheduled issue from template

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    # Get the title, labels, assignees, and body of the issue template at the path,
    # .github/ISSUE_TEMPLATE/my_template.md, if available.
    - uses: imjohnbo/extract-issue-template-fields@v1
      id: extract
      with:
        path: .github/ISSUE_TEMPLATE/my_template.md

    # Create new issue with assignees, labels, title, and body
    - uses: imjohnbo/issue-bot@v3
      with:
        assignees: ${{ steps.extract.outputs.assignees }}
        labels: ${{ steps.extract.outputs.labels }}
        title: ${{ steps.extract.outputs.title }}
        body: ${{ steps.extract.outputs.body }}

Contributing

Feel free to open an issue, or better yet, a pull request!

License

MIT