Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nickderobertis/check-if-issue-exists-action
Checks if a Github issue exists
https://github.com/nickderobertis/check-if-issue-exists-action
Last synced: 2 months ago
JSON representation
Checks if a Github issue exists
- Host: GitHub
- URL: https://github.com/nickderobertis/check-if-issue-exists-action
- Owner: nickderobertis
- License: mit
- Created: 2020-01-19T14:23:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T03:28:16.000Z (about 2 years ago)
- Last Synced: 2024-04-16T07:24:57.718Z (9 months ago)
- Language: Python
- Size: 29.3 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Check if Issue Exists Action
This Github action queries for an issue in a Github repository,
exposing an output for whether an issue matching that query exists.## Inputs
### Required Inputs
#### `repo`
Which repo to check issues in. Must include the owner of the repo, e.g. `nickderobertis/check-if-issue-exists-action`
#### `token`
Github token
### Query Inputs
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.#### `title`
Check for issues matching this title exactly.
#### `labels`
Check for issues matching these labels. Can pass a comma-separated list of labels or a single label.
## Outputs
### `exists`
Set to `true` if the queried issue exists and `false` otherwise.
## Example usage
```yaml
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:```yaml
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 }}
```## Development Guide
### Build Image
Use the script `build.sh` to build the image.
### Run Tests
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.#### Set up Environment for Tests
Copy `env.template.sh` to `env.sh` and add your Github token.
#### Run Tests
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.
```## Author
By Nick DeRobertis, licensed MIT.