This Github action queries for an issue in a Github repository, exposing an output for whether an issue matching that query exists.
Which repo to check issues in. Must include the owner of the repo, e.g. nickderobertis/check-if-issue-exists-action
Github token
All query inputs are optional, but at least one query input must be passed. If multiple query inputs are passed, the issue must match all of them.
Check for issues matching this title exactly.
Check for issues matching these labels. Can pass a comma-separated list of labels or a single label.
Set to true
if the queried issue exists and false
otherwise.
uses: nickderobertis/check-if-issue-exists-action@master
id: check_if_issue_exists
with:
repo: myuser/my-target-repo
token: ${{ secrets.GITHUB_TOKEN }}
title: Add some stuff
labels: good first issue, enhancement
This is useful in a workflow that creates an issue, to not create that issue if it already exists. For example:
steps:
- uses: nickderobertis/check-if-issue-exists-action@master
name: Check if Issue Exists
id: check_if_issue_exists
with:
repo: myuser/my-target-repo
token: ${{ secrets.GITHUB_TOKEN }}
title: Add some stuff
labels: good first issue, enhancement
- name: Create Issue
if: steps.check_if_issue_exists.outputs.exists == 'false'
uses: JasonEtco/create-an-issue@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Use the script build.sh
to build the image.
Tests are run on the CI when code is pushed. But they can also be run locally. Before doing that, the environment must be set up.
Copy env.template.sh
to env.sh
and add your Github token.
Run ./tests/run-tests.sh
from the main project directory. You should see the
build of the image and then:
Test to return true passed.
Test to return false passed.
By Nick DeRobertis, licensed MIT.