Releases: reaction-link/actions-lint-pull-request
v3
Full Changelog: v2...v3
v2
Static linting for pull requests
This release supports linting pull request titles and descriptions by testing against a regular expression, supplies as action input.
If the linting fails, you can configure the action to automatically leave a comment explaining the rules for pull request structure. You are free to add as many rules as you want.
If the pull request passes, the action will clean up after itself to not clutter your pull request with unnecessary comments. You are also able to supply a set of labels that can be added on success, to allow prefiltering your pull requests and see which are ready for review from a structural perspective.
Example workflow:
name: Lint Pull Request
on:
pull_request:
types: [opened, edited]
jobs:
lint-pull-request:
name: Lint Pull Request
runs-on: ubuntu-latest
steps:
- name: Lint Pull Request
uses: reaction-link/actions-lint-pull-request@v2
with:
access-token: ${{secrets.GITHUB_TOKEN}}
token-login: github-actions[bot]
github-event: ${{toJson(github.event)}}
use-title-regex: '(Feature|Bugfix|Hotfix|Release)(\/REA-\d+)?:\s\w+'
use-approval-labels: '["Good Structure"]'
use-explanation-title: '["- There must be a title in this format: `Feature|Bugfix|Hotfix|Release: Title`","- If applicable, add your issue ticket (e.g. `REA-100`) with a slash in the title","- Use `Feature` for enhancements or new functionality","- Use `Bugfix` only if you fixed a known bug","- Use `Hotfix` for problems introduced by previous merges","- Use proper capitalization in your title"]'
Result on fail
Result on success
Caveats
- You can supply
access-token: ${{secrets.GITHUB_TOKEN}}
andtoken-login: github-actions[bot]
if you don't have a bot account. - You can supply your own user-login and a personal access token for your account (stored as a secret in private repositories) to leave comments on your behalf
- Use the raw regular expression, don't enclose the expression in
\\
- Supply a flag for the expression with the additional inputs available
- Have a look at the README or the action.yml to see available inputs, their use-cases and what is happening to them (some are JSON parsed and require string escaping for example!)
- Configure the action to be a required action for pull requests against protected branches to enforce your pull request structure rules
- Combine GitHub's ability to auto-link to project management software if it detects an issue key by supplying a regular expression that requires an issue key to be existent (or make it optional like in the example above)
Happy Linting
v1
Static linting for pull requests
This release supports linting pull request titles and descriptions by testing against a regular expression, supplies as action input.
If the linting fails, you can configure the action to automatically leave a comment explaining the rules for pull request structure. You are free to add as many rules as you want.
If the pull request passes, the action will clean up after itself to not clutter your pull request with unnecessary comments. You are also able to supply a set of labels that can be added on success, to allow prefiltering your pull requests and see which are ready for review from a structural perspective.
Example workflow:
name: Lint Pull Request
on:
pull_request:
types: [opened, edited]
jobs:
lint-pull-request:
name: Lint Pull Request
runs-on: ubuntu-latest
steps:
- name: Lint Pull Request
uses: reaction-link/actions-lint-pull-request@v1
with:
config-bot-repotoken: ${{secrets.SOME_SECRET}}
config-bot-login: mybotaccount
github-event: ${{toJson(github.event)}}
use-title-regex: '(Feature|Bugfix|Hotfix|Release)(\/REA-\d+)?:\s\w+'
use-approval-labels: '["Good Structure"]'
use-explanation-title: '["- There must be a title in this format: `Feature|Bugfix|Hotfix|Release: Title`","- If applicable, add your issue ticket (e.g. `REA-100`) with a slash in the title","- Use `Feature` for enhancements or new functionality","- Use `Bugfix` only if you fixed a known bug","- Use `Hotfix` for problems introduced by previous merges","- Use proper capitalization in your title"]'
Result on fail
Result on success
Caveats
- You can supply
config-bot-repotoken: ${{secrets.GITHUB_TOKEN}}
andconfig-bot-login: github-actions
if you don't have a bot account. - You can supply your own user-login and a personal access token for your account (stored as a secret in private repositories) to leave comments on your behalf
- Currently linting is limited to the pull request title and its description, other aspects will follow (commit messages, amount of commits, etc.)
- Use the raw regular expression, don't enclose the expression in
\\
- Supply a flag for the expression with the additional inputs available
- Have a look at the README or the action.yml to see available inputs, their use-cases and what is happening to them (some are JSON parsed and require string escaping for example!)
- Configure the action to be a required action for pull requests against protected branches to enforce your pull request structure rules
- Combine GitHub's ability to auto-link to project management software if it detects an issue key by supplying a regular expression that requires an issue key to be existent (or make it optional like in the example above)