Validate (lint) GitHub issues.
Project description
gh-issue-validator
gh-issue-validator is a customizable "linter" for issues in a GitHub repository.
It ensures issues conform to a specified format.
When an issue doesn't conform to the desired format, a bot will post a comment including all errors found.
Installation
You typically wouldn't install this package on your local machine. It expects to be used in GitHub Actions.
Usage
gh-issue-validator allows you to use first-party checks or custom checks.
The following example uses some of the included first-party checks:
from gh_issue_validator import validate
from gh_issue_validator.checks.headings import CheckMissingHeadings, HeadingRequirement
HEADING_REQUIREMENTS =[
{"heading": "Problem statement", "min_words": 10},
{"heading": "Proposed solution", "min_words": 5, "max_words": 100},
]
validate(checks=[
CheckMissingHeadings(requirements=HEADING_REQUIREMENTS),
CheckWordCount(requirements=HEADING_REQUIREMENTS),
])
If the file above lives at .github/issue_validator.py, you can write a GitHub Actions
workflow like so to run it:
on:
issues:
types:
- "opened"
- "edited"
- "labeled"
- "unlabeled"
jobs:
validate:
# Filter for only issues labeled as "initiative"
if: "contains(github.event.issue.labels.*.name, 'initiative')"
runs-on: "ubuntu-latest"
permissions:
issues: "write"
steps:
- uses: "actions/checkout@v4"
- uses: "astral-sh/setup-uv@v5"
- run: "uv run .github/issue_validator.py"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_ISSUE_NUMBER: "${{ github.event.issue.number }}"
Check out our quickstart documentation for full usage instructions, including defining custom checks!
See the API documentation for full descriptions of the toolkit.
Development
Please see our contributor guide to get started with development.
Acknowledgement
This validator is inspired by the https://github.com/2i2c-org/initiatives project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gh_issue_validator-0.0.3.tar.gz.
File metadata
- Download URL: gh_issue_validator-0.0.3.tar.gz
- Upload date:
- Size: 80.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad1c595ab25a90db750684dbe938cccc718fbcafb7c251e1d31ed64b58f6b292
|
|
| MD5 |
10236af47e2856d2880be1fedcb370da
|
|
| BLAKE2b-256 |
bde810a6f21d04ab80550f7a0476059da1af798dde7421e06913f698e8d7da05
|
Provenance
The following attestation bundles were made for gh_issue_validator-0.0.3.tar.gz:
Publisher:
publish.yml on mfisher87/gh-issue-validator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gh_issue_validator-0.0.3.tar.gz -
Subject digest:
ad1c595ab25a90db750684dbe938cccc718fbcafb7c251e1d31ed64b58f6b292 - Sigstore transparency entry: 1366817388
- Sigstore integration time:
-
Permalink:
mfisher87/gh-issue-validator@599d88c61e4bc6dd07a59b934d2e43a2a3656b80 -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/mfisher87
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@599d88c61e4bc6dd07a59b934d2e43a2a3656b80 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gh_issue_validator-0.0.3-py3-none-any.whl.
File metadata
- Download URL: gh_issue_validator-0.0.3-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d933b3dbcfc102ead1d1b4706dfd6daba4ee5b05cc5c90f29889701b7984d71
|
|
| MD5 |
4a50d709f634c092789dabf8d51fa5a8
|
|
| BLAKE2b-256 |
c1971997193406c39d1e07ba848433cb608d457943af2dd62a450ba14f5a3208
|
Provenance
The following attestation bundles were made for gh_issue_validator-0.0.3-py3-none-any.whl:
Publisher:
publish.yml on mfisher87/gh-issue-validator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gh_issue_validator-0.0.3-py3-none-any.whl -
Subject digest:
5d933b3dbcfc102ead1d1b4706dfd6daba4ee5b05cc5c90f29889701b7984d71 - Sigstore transparency entry: 1366817397
- Sigstore integration time:
-
Permalink:
mfisher87/gh-issue-validator@599d88c61e4bc6dd07a59b934d2e43a2a3656b80 -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/mfisher87
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@599d88c61e4bc6dd07a59b934d2e43a2a3656b80 -
Trigger Event:
release
-
Statement type: