Skip to content

GitHub Actions powered Issue Bot 🦾

License

Notifications You must be signed in to change notification settings

eekdageek/issue-bot

 
 

Repository files navigation

Issue Bot

About

Work on a distributed team? Try using Issue Bot as a Scrum standup process automation bot to keep track of what you're all working on. 🤖

Have repeated tasks you're setting reminders for elsewhere? Issue Bot's got your back there, too. 👏

Or just need an issue created on a certain condition? Issue Bot is there when your CI build breaks. 💔

Issue Bot is a flexible GitHub Action that will open a new issue based on input values issue template of your choice. You can make it close the most recent one of its type, you can pin it, and since it's open source, pull requests are welcome!

Usage

As a daily standup bot:

name: Daily Standup
on:
  schedule:
  - cron: 0 12 * * *  # Every day at noon – https://crontab.guru

jobs:
  daily_standup:
    name: Daily Standup
    runs-on: ubuntu-latest
    steps:

    # Repo code checkout required if `template` is used
    - name: Checkout
      uses: actions/checkout@v2
      
    - name: issue-bot
      uses: imjohnbo/issue-bot@v2
      with:
        assignees: "comma, delimited, list, of, handles" # GitHub handles without the @
        labels: "standup"
        pinned: true
        close-previous: true
        template: ".github/ISSUE_TEMPLATE/standup.md" # assignees, labels will be overridden if present in YAML header
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

To keep track of repeated tasks:

name: Generate TPS reports
on:
  schedule:
  - cron: 0 0 1 * *  # First of every month – https://crontab.guru

jobs:
  tps_reports:
    name: TPS reports
    runs-on: ubuntu-latest
    steps:

    # Repo code checkout required if `template` is used
    - name: Checkout
      uses: actions/checkout@v2

    - name: issue-bot
      uses: imjohnbo/issue-bot@v2
      with:
        assignees: "me"     # your GitHub handle without the @
        labels: "tps, bug"
        pinned: false
        close-previous: false
        template: "tps.md" 
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Or just downstream of a failed CI step 💔:

name: Continuous Integration
on:
  [push, pull_request]

jobs:
  ci:
    name: CI
    runs-on: ubuntu-latest
    steps:

    # Repo code checkout required if `template` is used
    - name: Checkout
      uses: actions/checkout@v2

    - name: CI
      run: |
        echo "...these are some CI steps..."

    - name: issue-bot
      if: failure()
      uses: imjohnbo/issue-bot@v2
      with:
        assignees: "handles, of, my, teammates"    # GitHub handles without the @
        label: "ci"
        pinned: false
        close-previous: false
        template: "ci-failure.md"
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

In action:

Issue Bot Image

Inputs

  • labels: Comma delimited list of issue labels. Required value either as input or in YAML header of issue template.
  • title: Issue title. Required value either as input or in YAML header of issue template.
  • assignees: Comma delimited list of issue assignees.
  • body: Issue body.
  • pinned: Whether to pins the issue and unpin the previous one.
  • close-previous: Whether to close the most recent previous issue with a matching label.
  • template: Path to template used in issue, eg. .github/ISSUE_TEMPLATE/bug_report.md. Can also be a normal Markdown file with no YAML header (converted to body), in which case, labels, title, and assignees can be provided as inputs.

Outputs

  • issue-number: new issue number, if successfully created.

Environment variables

Contributing

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

License

MIT

About

GitHub Actions powered Issue Bot 🦾

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%