-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add pr-title check and pre-commit action (#29)
- Loading branch information
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: lint-pr-title | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, reopened, synchronize] | ||
|
||
jobs: | ||
pr-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: morrisoncole/[email protected] | ||
with: | ||
# Note: if you have branch protection rules enabled, the `GITHUB_TOKEN` permissions | ||
# won't cover dismissing reviews. Your options are to pass in a custom token | ||
# (perhaps by creating some sort of 'service' user and creating a personal access | ||
# token with the correct permissions) or to turn off `on-failed-regex-request-changes` | ||
# and use action failure to prevent merges instead (with | ||
# `on-failed-regex-fail-action: true`). See: | ||
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token | ||
# https://docs.github.com/en/rest/pulls/reviews#dismiss-a-review-for-a-pull-request | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
title-regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)' | ||
on-failed-regex-fail-action: true | ||
on-failed-regex-create-review: false | ||
on-failed-regex-request-changes: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: pre-commit | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: install pre-commit | ||
run: pip install pre-commit | ||
|
||
- name: Build dependencies Helm - nidhogg | ||
uses: WyriHaximus/github-action-helm3@v4 | ||
with: | ||
exec: helm dependency build charts/nidhogg | ||
|
||
- name: pre-commit | ||
run: pre-commit run --all-files --show-diff-on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters