A GitHub Action for marking issues as dependent on another
It works with PRs and issues and supports cross-repository dependencies.
Create .github/workflows/dependent-issues.yml
with the following content:
name: Dependent Issues
on:
issues:
types:
- opened
- edited
- reopened
pull_request_target:
types:
- opened
- edited
- reopened
# Makes sure we always add status check for PRs. Useful only if
# this action is required to pass before merging. Can be removed
# otherwise.
- synchronize
# Schedule a daily check. Useful if you reference cross-repository
# issues or pull requests. Can be removed otherwise.
schedule:
- cron: '0 0 * * *'
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: z0al/dependent-issues@v1
env:
# (Required) The token to use to make API calls to GitHub.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# (Optional) The token to use to make API calls to GitHub for remote repos.
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
with:
# (Optional) The label to use to mark dependent issues
label: dependent
# (Optional) Enable checking for dependencies in issues.
# Enable by setting the value to "on". Default "off"
check_issues: off
# (Optional) A comma-separated list of keywords. Default
# "depends on, blocked by"
keywords: depends on, blocked by
Here how it can look like in practice:
- label (Optional): The label to use to mark dependent issues. Default
dependent
. - check_issues (Optional): Enable checking for dependencies in issues. Enable by setting the value to
on
. Defaultoff
. - keywords (Optional): A comma-separated list of keywords. Default
depends on, blocked by
.
- GITHUB_TOKEN (Required): The token to use to make API calls to GitHub.
Trouble setting up the action? Check the FAQ.
- March 20, 2021: To avoid unnecessary failure due to insufficient permissions on Dependabot PRs, all Dependabot issues and pull requests are now ignored. This behavior is not configurable.
Special thanks to Jason Etcovitch for the original bot idea.
MIT © Ahmed T. Ali