• Stars
    star
    268
  • Rank 153,144 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 6 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A GitHub Action for creating a new issue from a template file.

Create an Issue Action

A GitHub Action that creates a new issue using a template file.

GitHub Actions status Codecov

Usage

This GitHub Action creates a new issue based on an issue template file. Here's an example workflow that creates a new issue any time you push a commit:

# .github/workflows/issue-on-push.yml
on: [push]
name: Create an issue on push
permissions:
  contents: read
  issues: write 
jobs:
  stuff:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: JasonEtco/create-an-issue@v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

This reads from the .github/ISSUE_TEMPLATE.md file. This file should have front matter to help construct the new issue:

---
title: Someone just pushed
assignees: JasonEtco, matchai
labels: bug, enhancement
---
Someone just pushed, oh no! Here's who did it: {{ payload.sender.login }}.

You'll notice that the above example has some {{ mustache }} variables. Your issue templates have access to several things about the event that triggered the action. Besides issue and pullRequest, you have access to all the template variables on this list. You can also use environment variables:

- uses: JasonEtco/create-an-issue@v2
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    ADJECTIVE: great
Environment variables are pretty {{ env.ADJECTIVE }}, right?

Note that you can only assign people matching given conditions.

Dates

Additionally, you can use the date filter and variable to show some information about when this issue was created:

---
title: Weekly Radar {{ date | date('dddd, MMMM Do') }}
---
What's everyone up to this week?

This example will create a new issue with a title like Weekly Radar Saturday, November 10th. You can pass any valid Moment.js formatting string to the filter.

Custom templates

Don't want to use .github/ISSUE_TEMPLATE.md? You can pass an input pointing the action to a different template:

steps:
  - uses: actions/checkout@v3
  - uses: JasonEtco/create-an-issue@v2
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    with:
      filename: .github/some-other-template.md

Inputs

Want to use Action logic to determine who to assign the issue to, to assign a milestone or to update an existing issue with the same title? You can pass an input containing the following options:

steps:
  - uses: actions/checkout@v3
  - uses: JasonEtco/create-an-issue@v2
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    with:
      assignees: JasonEtco, octocat
      milestone: 1
      update_existing: true
      search_existing: all
  • The assignees and milestone speak for themselves.
  • The update_existing param can be passed and set to true when you want to update an open issue with the exact same title when it exists and false if you don't want to create a new issue, but skip updating an existing one.
  • The search_existing param lets you specify whether to search open, closed, or all existing issues for duplicates (default is open).

Outputs

If you need the number or URL of the issue that was created for another Action, you can use the number or url outputs, respectively. For example:

steps:
  - uses: JasonEtco/create-an-issue@v2
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    id: create-issue
  - run: 'echo Created issue number ${{ steps.create-issue.outputs.number }}'
  - run: 'echo Created ${{ steps.create-issue.outputs.url }}'

More Repositories

1

actions-toolkit

🛠 A toolkit for building GitHub Actions in Node.js
TypeScript
928
star
2

todo

🤖✅ GitHub App that creates new issues from actionable comments in your code.
JavaScript
741
star
3

rss-to-readme

📡📝 A GitHub Action that updates a section of a README from an RSS feed.
TypeScript
221
star
4

is-sponsor-label-action

💖🔖 A GitHub Action that labels issues/PRs if the author sponsors the owner of the repo
JavaScript
221
star
5

activity-box

⚡️📌 Update a pinned gist to contain the latest activity of a user
JavaScript
212
star
6

upload-to-release

A GitHub Action that uploads a file to a new release.
Shell
177
star
7

build-and-tag-action

📦🔖 A GitHub Action for publishing JavaScript Actions
TypeScript
94
star
8

gist-box

📌📋 A helper class for updating a single-file Gist
TypeScript
84
star
9

action-badges

🛡⚡️ A README badge service for GitHub Actions
JavaScript
61
star
10

ci-reporter

🚧📝 GitHub App to show CI failure logs in PR comments
JavaScript
48
star
11

flintcms

🔥💥 A Node.js CMS
JavaScript
45
star
12

readme-box

📝⚙️ Lil' helper for replacing a section of the contents of a README.
TypeScript
31
star
13

npm-audit-fix-action

[WIP] GitHub Action that opens a pull request following an npm audit fix
JavaScript
29
star
14

jasonet.co

📝 My personal site and blog
Nunjucks
27
star
15

readme-guestbook

A little web app that transforms a README into a guestbook.
HTML
21
star
16

good-first-pin

🤖📌 A GitHub App built with Probot that rotates pinned issues based on Good First Issue labels
TypeScript
16
star
17

octokit-create-new-file

Creates a new file on a new branch and opens a new pull request.
JavaScript
15
star
18

action-record

📑 An "ORM" for storing data to a GitHub repository using GitHub Actions
TypeScript
13
star
19

smee-action

🔴📜 Use smee.io to debug GitHub Action runs
JavaScript
13
star
20

JasonEtco

11
star
21

slash-assign-action

A GitHub Action that listens for a `/assign` "command" and assigns the commenter to the issue.
TypeScript
10
star
22

github-user-status

A CLI for setting your GitHub user status
TypeScript
9
star
23

progressvg

💯% Progress bar as a service
JavaScript
6
star
24

push-to-gh-pages

📦💻 A GitHub Action that pushes a directory to the gh-pages branch
Shell
6
star
25

test-selector

🎭👈 Prompts the user to run specific test suites in a project.
JavaScript
6
star
26

validate-semver-release

🔖🤔 GitHub Action that validates GitHub Releases against semantic versioning
JavaScript
6
star
27

emojify-everything

🍆🔥💯 There aren't enough emojis in your websites. This extension fixes that.
JavaScript
6
star
28

signoff-commit-action

✍️ Action that creates an empty commit with a list of commits to "sign off on"
6
star
29

craft-emailwhitelist

🔒✉ A whitelist of emails for Craft
PHP
5
star
30

dotfiles

💻 Public repo for my personal dotfiles.
Shell
3
star
31

actions-counter

JavaScript
3
star
32

flintcms-site

📙 Landing page & Docs for FlintCMS
CSS
2
star
33

nunjucks-octicons-extension

A Nunjucks extension for using Octicons
JavaScript
2
star
34

jolt

CSS
2
star
35

text-to-emoji

JavaScript
2
star
36

streamydoo

Easy to use stream request handler for your browser
JavaScript
1
star
37

hover

Example of WebSockets using hover behaviors
JavaScript
1
star
38

find-code

🔍💻 Find code snippets in your project
JavaScript
1
star
39

business-card

JavaScript
1
star
40

notarikon4d

JavaScript
1
star
41

tote

[WIP] 👜 tote, a markdown note-taking PWA
JavaScript
1
star
42

khaliun-batmunkh

JavaScript
1
star
43

url-shortener

🔗 URL Shortener, built on a 🚆
JavaScript
1
star
44

grunt-jekyll-post

Prompts questions in command line, then creates a Jekyll post template with the answers.
JavaScript
1
star
45

talks

A repo to store my conference talk slide decks
1
star
46

nunjucks-pre-lexer

🤓 A tool for identifying and fetching the data that a Nunjucks template expects
TypeScript
1
star
47

notarikon

Notarikon means deriving a word from the first letter of each word in a sentence (using an anagram)
JavaScript
1
star
48

smee-client-rb

[WIP]: A programmatic client for Smee, in Ruby.
Ruby
1
star
49

dinner

🦃 Cyberspace Thanksgiving Dinner, with all the people you'd expect.
JavaScript
1
star
50

nunjucks-await-filter

Brings async/await functions to your Nunjucks templates.
JavaScript
1
star
51

server-smee-action

An Action for Servers with Smee
TypeScript
1
star
52

a-learning-lab-course-template

The template repository for the a-learning-lab-course course on Learning Lab.
1
star
53

ondesign-xyz

JavaScript
1
star
54

revolution

JavaScript
1
star
55

personal-site

🌈👌😁 My personal website and portfolio
JavaScript
1
star
56

discord-namer

🎮 Changes my Discord nickname when I'm @-mentioned, using a random emoji.
JavaScript
1
star
57

github-bulk-transfer

Simple CLI utility to trigger bulk transfers of github repos through a headless browser
JavaScript
1
star