From 171bb0e3d9bdfb1cc6b4ba839d86c5aec506a736 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Thu, 29 Dec 2022 09:37:18 +0800
Subject: [PATCH 001/153] docs: update badge icon and link
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 3b9414d..5061b01 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# Commit-Check GitHub Action

-[](https://github.com/marketplace/actions/commit-check)
+[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, referencing Jira tickets, and more.
From 65214c16d4286aa4655630a3b6fc03bccfb651ac Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Thu, 29 Dec 2022 09:53:34 +0800
Subject: [PATCH 002/153] feat: add commit-check.yml and update readme
---
.github/dependabot.yml | 4 ---
.github/workflows/commit-check.yml | 16 +++++++++++
.github/workflows/main.yaml | 13 ---------
README.md | 43 +++++++++++++++++++++++++++++-
4 files changed, 58 insertions(+), 18 deletions(-)
create mode 100644 .github/workflows/commit-check.yml
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 95bb02f..755e981 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -5,10 +5,6 @@
version: 2
updates:
- - package-ecosystem: docker
- directory: /
- schedule:
- interval: "weekly"
- package-ecosystem: github-actions
directory: /
schedule:
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
new file mode 100644
index 0000000..28e5add
--- /dev/null
+++ b/.github/workflows/commit-check.yml
@@ -0,0 +1,16 @@
+name: Commit Check
+
+on: pull_request
+
+jobs:
+ commit-check:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: commit-check/commit-check-action@v1
+ with:
+ message: true
+ branch: true
+ author-name: true
+ author-email: true
+ dry-run: true
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index 0ad072d..feb608a 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -41,16 +41,3 @@ jobs:
git push --delete origin v1 || true
git tag -a v1 -m 'Retag v1'
git push origin v1
-
- commit-check:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - uses: commit-check/commit-check-action@v1
- id: check
- with:
- message: true
- branch: true
- author-name: true
- author-email: true
- dry-run: true
diff --git a/README.md b/README.md
index 5061b01..c6f9013 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,29 @@
A Github Action for checking commit message formatting, branch naming, referencing Jira tickets, and more.
+## Usage
+
+Create a new GitHub Actions workflow in your project, e.g. at [.github/workflows/commit-check.yml](.github/workflows/commit-check.yml)
+
+```yaml
+name: Commit Check
+
+on: pull_request
+
+jobs:
+ commit-check:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: commit-check/commit-check-action@v1
+ with:
+ message: true
+ branch: true
+ author-name: true
+ author-email: true
+ dry-run: true
+```
+
## Optional Inputs
### `message`
@@ -36,8 +59,26 @@ A Github Action for checking commit message formatting, branch naming, referenci
Note: to change the default rules of above inputs, just add your own [`.commit-check.yml`](https://github.com/commit-check/commit-check#usage) config file.
+## Add Commit Check Action badge in README
+
+You can show Commit Check Action status with a badge in your repository README
+
+Example
+
+```
+[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)
+```
+
+[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)
+
## Versioning
Versioning follows [Semantic Versioning](https://semver.org/).
-[](https://ko-fi.com/H2H85WC9L)
+## Have question or feedback?
+
+To provide feedback (requesting a feature or reporting a bug) please post to [issues](https://github.com/commit-check/commit-check/issues).
+
+## License
+
+[MIT License](LICENSE)
From a690dc59e0bcff8b57993f9a4b78d3066ead1772 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 29 Dec 2022 01:54:13 +0000
Subject: [PATCH 003/153] chore(deps): bump commit-check from 0.2.3 to 0.2.4
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.2.3 to 0.2.4.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.2.3...v0.2.4)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index a4e5b42..c9cbabd 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.2.3
+commit-check==0.2.4
From 1019114f2d6f2dbe71d358a7f72e8badd061fcea Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Thu, 29 Dec 2022 10:22:28 +0800
Subject: [PATCH 004/153] chore: add .commit-check.yml config file
---
.commit-check.yml | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 .commit-check.yml
diff --git a/.commit-check.yml b/.commit-check.yml
new file mode 100644
index 0000000..45339d2
--- /dev/null
+++ b/.commit-check.yml
@@ -0,0 +1,25 @@
+checks:
+
+ - check: commit_message
+ regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)'
+ error: "The commit message should be structured as follows:\n\n
+ [optional scope]: \n
+ [optional body]\n
+ [optional footer(s)]\n\n
+ More details please refer to https://www.conventionalcommits.org"
+ suggest: 'git commit --amend'
+
+ - check: branch_name
+ regex: '^(bugfix|feature|release|hotfix|task)\/.+|(master)|(main)|(HEAD)|(PR-.+)'
+ error: 'Branches must begin with these types: bugfix/ feature/ release/ hotfix/ task/'
+ suggest: 'git checkout -b type/branch_name'
+
+ - check: author_name
+ regex: r'^([a-zA-Z]{2,}\s[a-zA-Z]{1,}'?-?[a-zA-Z]{2,}\s?([a-zA-Z]{1,})?)'
+ error: 'The user name seems invalid'
+ suggest: 'git config user.name "Peter Shen"'
+
+ - check: author_email
+ regex: '^\S+@\S+\.\S+$'
+ error: 'The email address seems invalid'
+ suggest: 'git config user.email xianpeng.shen@gmail.com'
From b33f199168a778d076d5d2c4b032b2dca41702a4 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Thu, 29 Dec 2022 10:25:39 +0800
Subject: [PATCH 005/153] chore: Update workflows
---
.github/workflows/commit-check.yml | 6 +++++-
.github/workflows/main.yaml | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 28e5add..129e694 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -1,6 +1,10 @@
name: Commit Check
-on: pull_request
+on:
+ push:
+ branches: 'main'
+ pull_request:
+ branches: 'main'
jobs:
commit-check:
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index feb608a..3076451 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -1,4 +1,4 @@
-name: main
+name: Main
on:
release:
From 5e280fd7ce82de13dd27d0be0199e547f4dc4635 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Thu, 5 Jan 2023 20:38:38 +0800
Subject: [PATCH 006/153] Update action.yml
---
action.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/action.yml b/action.yml
index 7552d81..b842850 100644
--- a/action.yml
+++ b/action.yml
@@ -1,4 +1,4 @@
-name: commit-check-action
+name: Commit Check Action
description: Check commit message formatting, branch naming, referencing Jira tickets, and more
author: shenxianpeng
branding:
From bedf7b99c4196477cf80f8669cf237583d81649f Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 16 Jan 2023 17:17:23 -0700
Subject: [PATCH 007/153] chore(deps): bump commit-check from 0.2.4 to 0.3.1
(#2)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.2.4 to 0.3.1.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.2.4...v0.3.1)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index c9cbabd..796723e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.2.4
+commit-check==0.3.1
From 25c7d73292af9b73a0daee800a5df820fc25ffc1 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 28 Jan 2023 04:49:19 +0000
Subject: [PATCH 008/153] chore(deps): bump commit-check from 0.3.1 to 0.3.3
(#3)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 796723e..6e99565 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.3.1
+commit-check==0.3.3
From f62457d00fa668f0d32b2edc81f1fb303150fe2c Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Wed, 1 Feb 2023 10:27:50 +0800
Subject: [PATCH 009/153] chore: update interval in dependabot.yml
---
.github/dependabot.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 755e981..0a723ca 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -12,4 +12,4 @@ updates:
- package-ecosystem: pip
directory: /
schedule:
- interval: "weekly"
+ interval: "daily"
From 402835d6492db01aae1df2289f9e5b4fabbbbf85 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 1 Feb 2023 10:29:19 +0800
Subject: [PATCH 010/153] chore(deps): bump commit-check from 0.3.3 to 0.4.0
(#4)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.3.3 to 0.4.0.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.3.3...v0.4.0)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 6e99565..a54aee2 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.3.3
+commit-check==0.4.0
From 0019571d804f6697a0deaa67f4cf0d375d1b325e Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Wed, 1 Feb 2023 10:47:56 +0800
Subject: [PATCH 011/153] docs: update README and .commit-check.yml
---
.commit-check.yml | 22 +++++++++++-----------
README.md | 25 ++++++++++++++++++-------
2 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/.commit-check.yml b/.commit-check.yml
index 45339d2..c624ad7 100644
--- a/.commit-check.yml
+++ b/.commit-check.yml
@@ -1,25 +1,25 @@
checks:
- check: commit_message
- regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)'
+ regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)|(Merge).*|(fixup!.*)'
error: "The commit message should be structured as follows:\n\n
[optional scope]: \n
[optional body]\n
[optional footer(s)]\n\n
More details please refer to https://www.conventionalcommits.org"
- suggest: 'git commit --amend'
+ suggest: git commit --amend --no-verify
- check: branch_name
- regex: '^(bugfix|feature|release|hotfix|task)\/.+|(master)|(main)|(HEAD)|(PR-.+)'
- error: 'Branches must begin with these types: bugfix/ feature/ release/ hotfix/ task/'
- suggest: 'git checkout -b type/branch_name'
+ regex: ^(bugfix|feature|release|hotfix|task)\/.+|(master)|(main)|(HEAD)|(PR-.+)
+ error: "Branches must begin with these types: bugfix/ feature/ release/ hotfix/ task/"
+ suggest: git checkout -b type/branch_name
- check: author_name
- regex: r'^([a-zA-Z]{2,}\s[a-zA-Z]{1,}'?-?[a-zA-Z]{2,}\s?([a-zA-Z]{1,})?)'
- error: 'The user name seems invalid'
- suggest: 'git config user.name "Peter Shen"'
+ regex: ^[a-z ,.\'-]+$|.*(\[bot])
+ error: The committer name seems invalid
+ suggest: git config user.name "Peter Shen"
- check: author_email
- regex: '^\S+@\S+\.\S+$'
- error: 'The email address seems invalid'
- suggest: 'git config user.email xianpeng.shen@gmail.com'
+ regex: ^\S+@\S+\.\S+$
+ error: The committer email seems invalid
+ suggest: git config user.email petershen@example.com
diff --git a/README.md b/README.md
index c6f9013..bb6e3b1 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@

[](https://github.com/marketplace/actions/commit-check-action)
-A Github Action for checking commit message formatting, branch naming, referencing Jira tickets, and more.
+A Github Action for checking commit message formatting, branch naming, committer name, email, and more.
## Usage
@@ -57,19 +57,30 @@ jobs:
- **Description**: run checks without failing
- Default: 'false'
-Note: to change the default rules of above inputs, just add your own [`.commit-check.yml`](https://github.com/commit-check/commit-check#usage) config file.
+Note: to change the default rules of above inputs, just add your own [`.commit-check.yml`](.commit-check.yml) config file.
-## Add Commit Check Action badge in README
+https://github.com/commit-check/commit-check#usage
-You can show Commit Check Action status with a badge in your repository README
+## Badging your repository
-Example
+You can add a badge to your repository to show your contributors / users that you use commit-check!
+
+[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)
+
+Markdown
+
+```
+[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)
+```
+
+reStructuredText
```
-[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)
+.. image:: https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml/badge.svg
+ :target: https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml
+ :alt: Commit Check
```
-[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)
## Versioning
From 8d3e10bc499af7ac4c8469f55af13aea53684eae Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Wed, 1 Feb 2023 10:55:23 +0800
Subject: [PATCH 012/153] docs: update README.md
---
README.md | 2 --
1 file changed, 2 deletions(-)
diff --git a/README.md b/README.md
index bb6e3b1..a1706a1 100644
--- a/README.md
+++ b/README.md
@@ -59,8 +59,6 @@ jobs:
Note: to change the default rules of above inputs, just add your own [`.commit-check.yml`](.commit-check.yml) config file.
-https://github.com/commit-check/commit-check#usage
-
## Badging your repository
You can add a badge to your repository to show your contributors / users that you use commit-check!
From 4ccfd1c9e2ad671089f1fa948244f59bd0411456 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Wed, 1 Feb 2023 13:42:16 +0800
Subject: [PATCH 013/153] chore: rename commit_message branch_name to message
branch
---
.commit-check.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.commit-check.yml b/.commit-check.yml
index c624ad7..fbe8070 100644
--- a/.commit-check.yml
+++ b/.commit-check.yml
@@ -1,6 +1,6 @@
checks:
- - check: commit_message
+ - check: message
regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)|(Merge).*|(fixup!.*)'
error: "The commit message should be structured as follows:\n\n
[optional scope]: \n
@@ -9,7 +9,7 @@ checks:
More details please refer to https://www.conventionalcommits.org"
suggest: git commit --amend --no-verify
- - check: branch_name
+ - check: branch
regex: ^(bugfix|feature|release|hotfix|task)\/.+|(master)|(main)|(HEAD)|(PR-.+)
error: "Branches must begin with these types: bugfix/ feature/ release/ hotfix/ task/"
suggest: git checkout -b type/branch_name
From 0c053cb1ac24999a33547266e66575cc41047ec7 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Wed, 1 Feb 2023 22:01:27 +0800
Subject: [PATCH 014/153] Delete FUNDING.yml
---
.github/FUNDING.yml | 3 ---
1 file changed, 3 deletions(-)
delete mode 100644 .github/FUNDING.yml
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
deleted file mode 100644
index a091a5d..0000000
--- a/.github/FUNDING.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-# These are supported funding model platforms
-ko_fi: shenxianpeng
-# custom: ["https://www.paypal.me/shenxianpeng"]
From 9e65726ed1e406934a070aa49d8e50d03e2d1f81 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Wed, 1 Feb 2023 22:15:09 +0800
Subject: [PATCH 015/153] fix: check author name regex
---
.commit-check.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.commit-check.yml b/.commit-check.yml
index fbe8070..008e02e 100644
--- a/.commit-check.yml
+++ b/.commit-check.yml
@@ -15,7 +15,7 @@ checks:
suggest: git checkout -b type/branch_name
- check: author_name
- regex: ^[a-z ,.\'-]+$|.*(\[bot])
+ regex: ^[A-Za-z ,.\'-]+$|.*(\[bot])
error: The committer name seems invalid
suggest: git config user.name "Peter Shen"
From 20b5a928740f58bf65e30a44d47568b3c18f35ab Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 2 Feb 2023 11:13:54 +0800
Subject: [PATCH 016/153] chore(deps): bump commit-check from 0.4.0 to 0.4.2
(#6)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.4.0 to 0.4.2.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.4.0...v0.4.2)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index a54aee2..47b7663 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.4.0
+commit-check==0.4.2
From 42c1fa3bf46e34290d07828ca81489eeee958cb9 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Thu, 2 Feb 2023 21:46:45 -0500
Subject: [PATCH 017/153] feat: add job summary (#8)
---
.github/workflows/commit-check.yml | 3 +-
README.md | 23 +++++++----
action.yml | 42 ++++++--------------
entrypoint | 63 ++++++++++++++++++++++++++++++
4 files changed, 93 insertions(+), 38 deletions(-)
create mode 100755 entrypoint
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 129e694..3c421da 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -2,7 +2,6 @@ name: Commit Check
on:
push:
- branches: 'main'
pull_request:
branches: 'main'
@@ -17,4 +16,4 @@ jobs:
branch: true
author-name: true
author-email: true
- dry-run: true
+ summary: true
diff --git a/README.md b/README.md
index a1706a1..0eb34c8 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,10 @@ Create a new GitHub Actions workflow in your project, e.g. at [.github/workflows
```yaml
name: Commit Check
-on: pull_request
+on:
+ push:
+ pull_request:
+ branches: 'main'
jobs:
commit-check:
@@ -26,20 +29,21 @@ jobs:
author-name: true
author-email: true
dry-run: true
+ summary: true
```
## Optional Inputs
### `message`
-- **Description**: check commit message formatting convention
- - By default the rule follows [conventionalcommits](https://www.conventionalcommits.org/)
+- **Description**: check commit message formatting convention.
+ - By default the rule follows [conventionalcommits](https://www.conventionalcommits.org/).
- Default: 'true'
### `branch`
-- **Description**: check git branch naming convention
- - By default follow bitbucket [branching model](https://support.atlassian.com/bitbucket-cloud/docs/configure-a-projects-branching-model/)
+- **Description**: check git branch naming convention.
+ - By default follow bitbucket [branching model](https://support.atlassian.com/bitbucket-cloud/docs/configure-a-projects-branching-model/).
- Default: 'true'
### `author-name`
@@ -54,10 +58,15 @@ jobs:
### `dry-run`
-- **Description**: run checks without failing
+- **Description**: run checks without failing. exit code is 0 otherwise is 1.
- Default: 'false'
-Note: to change the default rules of above inputs, just add your own [`.commit-check.yml`](.commit-check.yml) config file.
+### `summary`
+
+- **Description**: display job summary to a workflow run
+- Default: 'true'
+
+Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check/blob/main/.commit-check.yml), if you want to customize just add your `.commit-check.yml` config file under your repository root directory.
## Badging your repository
diff --git a/action.yml b/action.yml
index b842850..ef16335 100644
--- a/action.yml
+++ b/action.yml
@@ -1,5 +1,5 @@
name: Commit Check Action
-description: Check commit message formatting, branch naming, referencing Jira tickets, and more
+description: Check commit message formatting, branch naming, committer name, email, and more
author: shenxianpeng
branding:
icon: "git-commit"
@@ -25,35 +25,19 @@ inputs:
description: run checks without failing
required: false
default: false
+ summary:
+ description: add a job summary
+ required: false
+ default: true
runs:
using: "composite"
steps:
- - name: Install action dependencies
- shell: bash
- run: |
- if [[ "${{runner.os}}" == "Linux" ]]; then
- # https://github.com/pypa/setuptools/issues/3269
- export DEB_PYTHON_INSTALL_LAYOUT=deb
- fi
- python3 -m pip install -r '${{ github.action_path }}/requirements.txt'
- - name: Run commit-check
- id: commit-check
+ - run: ${{ github.action_path }}/entrypoint
shell: bash
- run: |
- args=""
- if [ "${{ inputs.message }}" == "true" ]; then
- args="$args --message"
- fi
- if [ "${{ inputs.branch }}" == "true" ]; then
- args="$args --branch"
- fi
- if [ "${{ inputs.author-name }}" == "true" ]; then
- args="$args --author-name"
- fi
- if [ "${{ inputs.author-email }}" == "true" ]; then
- args="$args --author-email"
- fi
- if [ "${{ inputs.dry-run }}" == "true" ]; then
- args="$args --dry-run"
- fi
- commit-check $args
+ env:
+ MESSAGE: ${{ inputs.message }}
+ BRANCH: ${{ inputs.branch }}
+ AUTHOR_NAME: ${{ inputs.author-name }}
+ AUTHOR_EMAIL: ${{ inputs.author-email }}
+ DRY_RUN: ${{ inputs.dry-run }}
+ SUMMARY: ${{ inputs.summary }}
diff --git a/entrypoint b/entrypoint
new file mode 100755
index 0000000..697b594
--- /dev/null
+++ b/entrypoint
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+ret_code=0
+
+install_deps(){
+ if [ "$RUNNER_OS" == "Linux" ]; then
+ # https://github.com/pypa/setuptools/issues/3269
+ export DEB_PYTHON_INSTALL_LAYOUT=deb
+ fi
+ python3 -m pip install -r requirements.txt
+}
+
+run_commit_check(){
+ args=""
+ if [ "$MESSAGE" == "true" ]; then
+ args="$args --message"
+ fi
+ if [ "$BRANCH" == "true" ]; then
+ args="$args --branch"
+ fi
+ if [ "$AUTHOR_NAME" == "true" ]; then
+ args="$args --author-name"
+ fi
+ if [ "$AUTHOR_EMAIL" == "true" ]; then
+ args="$args --author-email"
+ fi
+
+ echo "commit-check $args"
+ commit-check $args > result.txt
+ ret_code=$?
+}
+
+add_job_summary(){
+ if [ "$SUMMARY" == "false" ]; then
+ exit
+ fi
+
+ if [ -s result.txt ]; then
+ # strips ANSI colors
+ sed -i "s,\x1B\[[0-9;]*[a-zA-Z],,g" result.txt
+ cat result.txt
+ echo "### Commit-Check ❌" >> $GITHUB_STEP_SUMMARY
+ echo '```' >> $GITHUB_STEP_SUMMARY
+ cat result.txt >> $GITHUB_STEP_SUMMARY
+ echo '```' >> $GITHUB_STEP_SUMMARY
+ ret_code=1
+ else
+ echo "### Commit-Check ✔️" >> $GITHUB_STEP_SUMMARY
+ ret_code=0
+ fi
+}
+
+# start of main
+install_deps
+run_commit_check
+add_job_summary
+
+if [ "$DRY_RUN" == "true" ]; then
+ ret_code=0
+fi
+
+exit $ret_code
+# end of main
From 52b84905cd0f6d253d28e920b7f170a7146650fc Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Thu, 2 Feb 2023 22:56:28 -0500
Subject: [PATCH 018/153] docs: add screenshot to README.md (#9)
---
README.md | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/README.md b/README.md
index 0eb34c8..f8018fb 100644
--- a/README.md
+++ b/README.md
@@ -68,6 +68,18 @@ jobs:
Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check/blob/main/.commit-check.yml), if you want to customize just add your `.commit-check.yml` config file under your repository root directory.
+## GitHub Actions job summary
+
+By default, commit-check-action results are shown on the job summary page of the workflow.
+
+### Success summary
+
+
+
+### Failure summary
+
+
+
## Badging your repository
You can add a badge to your repository to show your contributors / users that you use commit-check!
From 605095fb41530558f6e2ee7591bfead4c167b27f Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Mon, 6 Feb 2023 18:55:45 -0700
Subject: [PATCH 019/153] refactor: change from summary to job-summary (#10)
---
.github/workflows/commit-check.yml | 2 +-
LICENSE | 21 ---------------------
README.md | 18 +++++++-----------
action.yml | 6 +++---
entrypoint => entrypoint.sh | 20 +++++++++-----------
5 files changed, 20 insertions(+), 47 deletions(-)
delete mode 100644 LICENSE
rename entrypoint => entrypoint.sh (71%)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 3c421da..fad54eb 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -16,4 +16,4 @@ jobs:
branch: true
author-name: true
author-email: true
- summary: true
+ job-summary: true
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 075dbce..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2022 Commit Check
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/README.md b/README.md
index f8018fb..c51c662 100644
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@ jobs:
author-name: true
author-email: true
dry-run: true
- summary: true
+ job-summary: true
```
## Optional Inputs
@@ -61,24 +61,24 @@ jobs:
- **Description**: run checks without failing. exit code is 0 otherwise is 1.
- Default: 'false'
-### `summary`
+### `job-summary`
- **Description**: display job summary to a workflow run
- Default: 'true'
Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check/blob/main/.commit-check.yml), if you want to customize just add your `.commit-check.yml` config file under your repository root directory.
-## GitHub Actions job summary
+## GitHub Action job summary
By default, commit-check-action results are shown on the job summary page of the workflow.
-### Success summary
+### Success job summary
-
+
-### Failure summary
+### Failure job summary
-
+
## Badging your repository
@@ -108,7 +108,3 @@ Versioning follows [Semantic Versioning](https://semver.org/).
## Have question or feedback?
To provide feedback (requesting a feature or reporting a bug) please post to [issues](https://github.com/commit-check/commit-check/issues).
-
-## License
-
-[MIT License](LICENSE)
diff --git a/action.yml b/action.yml
index ef16335..aa58901 100644
--- a/action.yml
+++ b/action.yml
@@ -25,14 +25,14 @@ inputs:
description: run checks without failing
required: false
default: false
- summary:
+ job-summary:
description: add a job summary
required: false
default: true
runs:
using: "composite"
steps:
- - run: ${{ github.action_path }}/entrypoint
+ - run: ${{ github.action_path }}/entrypoint.sh
shell: bash
env:
MESSAGE: ${{ inputs.message }}
@@ -40,4 +40,4 @@ runs:
AUTHOR_NAME: ${{ inputs.author-name }}
AUTHOR_EMAIL: ${{ inputs.author-email }}
DRY_RUN: ${{ inputs.dry-run }}
- SUMMARY: ${{ inputs.summary }}
+ JOB_SUMMARY: ${{ inputs.job-summary }}
diff --git a/entrypoint b/entrypoint.sh
similarity index 71%
rename from entrypoint
rename to entrypoint.sh
index 697b594..9c5451a 100755
--- a/entrypoint
+++ b/entrypoint.sh
@@ -2,7 +2,7 @@
ret_code=0
-install_deps(){
+install_dependencies(){
if [ "$RUNNER_OS" == "Linux" ]; then
# https://github.com/pypa/setuptools/issues/3269
export DEB_PYTHON_INSTALL_LAYOUT=deb
@@ -26,12 +26,12 @@ run_commit_check(){
fi
echo "commit-check $args"
- commit-check $args > result.txt
+ commit-check "$args" > result.txt
ret_code=$?
}
add_job_summary(){
- if [ "$SUMMARY" == "false" ]; then
+ if [ "$JOB_SUMMARY" == "false" ]; then
exit
fi
@@ -39,19 +39,18 @@ add_job_summary(){
# strips ANSI colors
sed -i "s,\x1B\[[0-9;]*[a-zA-Z],,g" result.txt
cat result.txt
- echo "### Commit-Check ❌" >> $GITHUB_STEP_SUMMARY
- echo '```' >> $GITHUB_STEP_SUMMARY
- cat result.txt >> $GITHUB_STEP_SUMMARY
- echo '```' >> $GITHUB_STEP_SUMMARY
+ echo "### Commit-Check ❌" >> "$GITHUB_STEP_SUMMARY"
+ echo '```' >> "$GITHUB_STEP_SUMMARY"
+ cat result.txt >> "$GITHUB_STEP_SUMMARY"
+ echo '```' >> "$GITHUB_STEP_SUMMARY"
ret_code=1
else
- echo "### Commit-Check ✔️" >> $GITHUB_STEP_SUMMARY
+ echo "### Commit-Check ✔️" >> "$GITHUB_STEP_SUMMARY"
ret_code=0
fi
}
-# start of main
-install_deps
+install_dependencies
run_commit_check
add_job_summary
@@ -60,4 +59,3 @@ if [ "$DRY_RUN" == "true" ]; then
fi
exit $ret_code
-# end of main
From 6f2eddc95d814524aac2d0c4dbefa303ba3628e6 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 9 Feb 2023 17:47:55 -0700
Subject: [PATCH 020/153] chore(deps): bump commit-check from 0.4.2 to 0.5.1
(#11)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.4.2 to 0.5.1.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.4.2...v0.5.1)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 47b7663..630d34a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.4.2
+commit-check==0.5.1
From 65ac4d36d74351d70cac30207f6d1a6d6662146d Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Tue, 14 Feb 2023 21:03:21 -0700
Subject: [PATCH 021/153] docs: create LICENSE
---
LICENSE | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 LICENSE
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..149b4e3
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 shenxianpeng (xianpeng.shen@gmail.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
From eb68373ba0017a86f49f2873394074c71aa341b2 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 25 Feb 2023 08:46:18 +0800
Subject: [PATCH 022/153] chore(deps): bump commit-check from 0.5.1 to 0.5.3
(#13)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.5.1 to 0.5.3.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.5.1...v0.5.3)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 630d34a..f31d6bd 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.5.1
+commit-check==0.5.3
From 6390e2c7feadce56d32285bebdce74c368aba4bb Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 6 Apr 2023 23:01:17 -0600
Subject: [PATCH 023/153] chore(deps): bump commit-check from 0.5.3 to 0.5.4
(#16)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.5.3 to 0.5.4.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.5.3...v0.5.4)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index f31d6bd..4c67149 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.5.3
+commit-check==0.5.4
From 30564fef2353058785b6503a81753005e18b2326 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Fri, 7 Apr 2023 21:06:05 +0800
Subject: [PATCH 024/153] fix: unrecognized arguments (#17)
---
entrypoint.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/entrypoint.sh b/entrypoint.sh
index 9c5451a..98703ea 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -26,7 +26,7 @@ run_commit_check(){
fi
echo "commit-check $args"
- commit-check "$args" > result.txt
+ commit-check $args > result.txt
ret_code=$?
}
From a7d7e72c49d7a85305ed160f175e09502e2ba87e Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Fri, 7 Apr 2023 13:09:43 +0000
Subject: [PATCH 025/153] chore: add workflow_dispatch event
---
.github/workflows/commit-check.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index fad54eb..700425f 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -4,6 +4,7 @@ on:
push:
pull_request:
branches: 'main'
+ workflow_dispatch:
jobs:
commit-check:
From b5f0514495376efbdd266ece7c2cf0d7cde1ebbd Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 14 Apr 2023 04:02:36 -0600
Subject: [PATCH 026/153] chore(deps): bump commit-check from 0.5.4 to 0.5.6
(#19)
* chore(deps): bump commit-check from 0.5.4 to 0.5.6
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.5.4 to 0.5.6.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.5.4...v0.5.6)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
* chore: support branch start with dependabot
---------
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: shenxianpeng
---
.commit-check.yml | 2 +-
requirements.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.commit-check.yml b/.commit-check.yml
index 008e02e..bfabe35 100644
--- a/.commit-check.yml
+++ b/.commit-check.yml
@@ -10,7 +10,7 @@ checks:
suggest: git commit --amend --no-verify
- check: branch
- regex: ^(bugfix|feature|release|hotfix|task)\/.+|(master)|(main)|(HEAD)|(PR-.+)
+ regex: ^(bugfix|feature|release|hotfix|task|dependabot)\/.+|(master)|(main)|(HEAD)|(PR-.+)
error: "Branches must begin with these types: bugfix/ feature/ release/ hotfix/ task/"
suggest: git checkout -b type/branch_name
diff --git a/requirements.txt b/requirements.txt
index 4c67149..be65bd7 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.5.4
+commit-check==0.5.6
From 183ae196ba3423f4801fc7cac5d48fae62c969c1 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Fri, 14 Apr 2023 08:25:09 -0600
Subject: [PATCH 027/153] refactor: Update entrypoint.sh (#20)
---
entrypoint.sh | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/entrypoint.sh b/entrypoint.sh
index 98703ea..3e365c7 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -1,9 +1,10 @@
#!/bin/bash
+set -euo pipefail
ret_code=0
install_dependencies(){
- if [ "$RUNNER_OS" == "Linux" ]; then
+ if [[ "$RUNNER_OS" == "Linux" ]]; then
# https://github.com/pypa/setuptools/issues/3269
export DEB_PYTHON_INSTALL_LAYOUT=deb
fi
@@ -12,16 +13,13 @@ install_dependencies(){
run_commit_check(){
args=""
- if [ "$MESSAGE" == "true" ]; then
+ if [[ "$MESSAGE" == "true" ]]; then
args="$args --message"
- fi
- if [ "$BRANCH" == "true" ]; then
+ elif [[ "$BRANCH" == "true" ]]; then
args="$args --branch"
- fi
- if [ "$AUTHOR_NAME" == "true" ]; then
+ elif [[ "$AUTHOR_NAME" == "true" ]]; then
args="$args --author-name"
- fi
- if [ "$AUTHOR_EMAIL" == "true" ]; then
+ elif [[ "$AUTHOR_EMAIL" == "true" ]]; then
args="$args --author-email"
fi
@@ -31,7 +29,7 @@ run_commit_check(){
}
add_job_summary(){
- if [ "$JOB_SUMMARY" == "false" ]; then
+ if [[ "$JOB_SUMMARY" == "false" ]]; then
exit
fi
@@ -54,7 +52,7 @@ install_dependencies
run_commit_check
add_job_summary
-if [ "$DRY_RUN" == "true" ]; then
+if [[ "$DRY_RUN" == "true" ]]; then
ret_code=0
fi
From b18b48afc821b905890f1e006c6e096df7048f18 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Wed, 19 Apr 2023 12:15:06 +0800
Subject: [PATCH 028/153] feat: create CODEOWNERS file
---
.github/CODEOWNERS | 1 +
1 file changed, 1 insertion(+)
create mode 100644 .github/CODEOWNERS
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 0000000..4f08a45
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1 @@
+* @shenxianpeng
From 3d602860a8e08c39800a80ea59e1470473c8dd3c Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Thu, 4 May 2023 11:57:56 +0800
Subject: [PATCH 029/153] chore: Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index c51c662..3512e9c 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
# Commit-Check GitHub Action
+[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
+[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

[](https://github.com/marketplace/actions/commit-check-action)
From e8c0354cb5b4da1dc1f062e38999a320891c6235 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 4 Sep 2023 23:20:25 -0400
Subject: [PATCH 030/153] chore(deps): bump actions/checkout from 3 to 4 (#21)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/commit-check.yml | 2 +-
.github/workflows/main.yaml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 700425f..bb45d9e 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -10,7 +10,7 @@ jobs:
commit-check:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: commit-check/commit-check-action@v1
with:
message: true
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index 3076451..913593d 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -19,7 +19,7 @@ jobs:
re-tag:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.ref }}
From a8a4d8a4e5fa8fc276db91abafcf168f4f2b90a5 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 3 Nov 2023 09:50:42 +0800
Subject: [PATCH 031/153] chore(deps): bump commit-check from 0.5.6 to 0.6.2
(#22)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.5.6 to 0.6.2.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.5.6...v0.6.2)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index be65bd7..2267a0d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.5.6
+commit-check==0.6.2
From a00832b3a9a0df00c17a32258ecbb064db17e846 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Sun, 19 Nov 2023 08:43:35 -0500
Subject: [PATCH 032/153] fix: update action.yml and entrypoint.sh to fix #23
(#25)
---
action.yml | 9 +++++++++
entrypoint.sh | 9 ---------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/action.yml b/action.yml
index aa58901..cf0b61f 100644
--- a/action.yml
+++ b/action.yml
@@ -32,6 +32,15 @@ inputs:
runs:
using: "composite"
steps:
+ - name: Install action dependencies
+ shell: bash
+ run: |
+ if [[ "$RUNNER_OS" == "Linux" ]]; then
+ # https://github.com/pypa/setuptools/issues/3269
+ export DEB_PYTHON_INSTALL_LAYOUT=deb
+ fi
+ python3 -m pip install -r "$GITHUB_ACTION_PATH/requirements.txt"
+ - name: Run commit-check
- run: ${{ github.action_path }}/entrypoint.sh
shell: bash
env:
diff --git a/entrypoint.sh b/entrypoint.sh
index 3e365c7..5389097 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -3,14 +3,6 @@ set -euo pipefail
ret_code=0
-install_dependencies(){
- if [[ "$RUNNER_OS" == "Linux" ]]; then
- # https://github.com/pypa/setuptools/issues/3269
- export DEB_PYTHON_INSTALL_LAYOUT=deb
- fi
- python3 -m pip install -r requirements.txt
-}
-
run_commit_check(){
args=""
if [[ "$MESSAGE" == "true" ]]; then
@@ -48,7 +40,6 @@ add_job_summary(){
fi
}
-install_dependencies
run_commit_check
add_job_summary
From c67a8441e491fb7500ccae8be352ec5d6680c47a Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Sun, 19 Nov 2023 21:48:16 +0800
Subject: [PATCH 033/153] fix: Update action.yml
---
action.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/action.yml b/action.yml
index cf0b61f..4edf280 100644
--- a/action.yml
+++ b/action.yml
@@ -41,8 +41,8 @@ runs:
fi
python3 -m pip install -r "$GITHUB_ACTION_PATH/requirements.txt"
- name: Run commit-check
- - run: ${{ github.action_path }}/entrypoint.sh
shell: bash
+ run: ${{ github.action_path }}/entrypoint.sh
env:
MESSAGE: ${{ inputs.message }}
BRANCH: ${{ inputs.branch }}
From 89635055a8f5224aff43c167caa8cd86ac13b175 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Sun, 19 Nov 2023 09:20:50 -0500
Subject: [PATCH 034/153] fix: Update entrypoint.sh (#26)
---
entrypoint.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/entrypoint.sh b/entrypoint.sh
index 5389097..d3dda19 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -7,11 +7,14 @@ run_commit_check(){
args=""
if [[ "$MESSAGE" == "true" ]]; then
args="$args --message"
- elif [[ "$BRANCH" == "true" ]]; then
+ fi
+ if [[ "$BRANCH" == "true" ]]; then
args="$args --branch"
- elif [[ "$AUTHOR_NAME" == "true" ]]; then
+ fi
+ if [[ "$AUTHOR_NAME" == "true" ]]; then
args="$args --author-name"
- elif [[ "$AUTHOR_EMAIL" == "true" ]]; then
+ fi
+ if [[ "$AUTHOR_EMAIL" == "true" ]]; then
args="$args --author-email"
fi
From 2f6a5c15c569aba3a10fe0ac280e81b9cbf7d181 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 21 Dec 2023 12:19:32 +0800
Subject: [PATCH 035/153] chore(deps): bump commit-check from 0.6.2 to 0.6.3
(#27)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.6.2 to 0.6.3.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.6.2...v0.6.3)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 2267a0d..fe4abfc 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.6.2
+commit-check==0.6.3
From 8bd1a407910f85181ffccd57c094f603f549eb90 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Wed, 27 Dec 2023 14:37:10 +0800
Subject: [PATCH 036/153] feat: add release.yml
---
.github/release.yml | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 .github/release.yml
diff --git a/.github/release.yml b/.github/release.yml
new file mode 100644
index 0000000..d1eca56
--- /dev/null
+++ b/.github/release.yml
@@ -0,0 +1,25 @@
+# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuration-options
+
+changelog:
+ exclude:
+ labels:
+ - ignore-for-release
+ categories:
+ - title: '🔥 Breaking Changes'
+ labels:
+ - 'breaking'
+ - title: 🏕 Features
+ labels:
+ - 'enhancement'
+ - title: '🐛 Bug Fixes'
+ labels:
+ - 'bug'
+ - title: '👋 Deprecated'
+ labels:
+ - 'deprecation'
+ - title: 👒 Dependencies
+ labels:
+ - dependencies
+ - title: Other Changes
+ labels:
+ - "*"
From 3826c351c343a347f74ce4ab09b2c359dceb3f9c Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 27 Dec 2023 14:38:38 +0800
Subject: [PATCH 037/153] chore(deps): bump commit-check from 0.6.3 to 0.7.0
(#28)
* chore(deps): bump commit-check from 0.6.3 to 0.7.0
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.6.3 to 0.7.0.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.6.3...v0.7.0)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
* feat: support checking committer signature
* feat: support checking committer signature
---------
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: shenxianpeng
---
README.md | 9 +++++++--
action.yml | 5 +++++
entrypoint.sh | 3 +++
requirements.txt | 2 +-
4 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 3512e9c..ae0507a 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@

[](https://github.com/marketplace/actions/commit-check-action)
-A Github Action for checking commit message formatting, branch naming, committer name, email, and more.
+A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
## Usage
@@ -39,7 +39,7 @@ jobs:
### `message`
- **Description**: check commit message formatting convention.
- - By default the rule follows [conventionalcommits](https://www.conventionalcommits.org/).
+ - By default the rule follows [conventional commits](https://www.conventionalcommits.org/).
- Default: 'true'
### `branch`
@@ -58,6 +58,11 @@ jobs:
- **Description**: check committer author email
- Default: 'true'
+### `commit-signoff`
+
+- **Description**: check committer commit signature
+- Default: 'true'
+
### `dry-run`
- **Description**: run checks without failing. exit code is 0 otherwise is 1.
diff --git a/action.yml b/action.yml
index 4edf280..4d02a9c 100644
--- a/action.yml
+++ b/action.yml
@@ -21,6 +21,10 @@ inputs:
description: check committer author email
required: false
default: true
+ commit-signoff:
+ description: check committer commit signature
+ required: false
+ default: true
dry-run:
description: run checks without failing
required: false
@@ -48,5 +52,6 @@ runs:
BRANCH: ${{ inputs.branch }}
AUTHOR_NAME: ${{ inputs.author-name }}
AUTHOR_EMAIL: ${{ inputs.author-email }}
+ COMMIT_SIGNOFF: ${{ inputs.commit-signoff }}
DRY_RUN: ${{ inputs.dry-run }}
JOB_SUMMARY: ${{ inputs.job-summary }}
diff --git a/entrypoint.sh b/entrypoint.sh
index d3dda19..0523cae 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -17,6 +17,9 @@ run_commit_check(){
if [[ "$AUTHOR_EMAIL" == "true" ]]; then
args="$args --author-email"
fi
+ if [[ "$COMMIT_SIGNOFF" == "true" ]]; then
+ args="$args --commit-signoff"
+ fi
echo "commit-check $args"
commit-check $args > result.txt
diff --git a/requirements.txt b/requirements.txt
index fe4abfc..26a8eed 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.6.3
+commit-check==0.7.0
From 3455135498bc779cef62a0e7eee1e7b7b9cadd19 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Wed, 27 Dec 2023 14:44:33 +0800
Subject: [PATCH 038/153] docs: update README.md
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index ae0507a..771b611 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,7 @@ jobs:
branch: true
author-name: true
author-email: true
+ commit-signoff: true
dry-run: true
job-summary: true
```
From 0454b6019fd8b0e7e3f53297534d054706ee2f1e Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Wed, 27 Dec 2023 14:45:28 +0800
Subject: [PATCH 039/153] docs: update README.md
Signed-off-by: shenxianpeng
---
.github/workflows/commit-check.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index bb45d9e..408838c 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -17,4 +17,5 @@ jobs:
branch: true
author-name: true
author-email: true
+ commit-signoff: true
job-summary: true
From a0c741bdfac19d016432f0ad9da03aa236dd8f54 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Fri, 29 Dec 2023 14:00:25 +0800
Subject: [PATCH 040/153] chore: Update release.yml
---
.github/release.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/release.yml b/.github/release.yml
index d1eca56..d82f279 100644
--- a/.github/release.yml
+++ b/.github/release.yml
@@ -17,7 +17,7 @@ changelog:
- title: '👋 Deprecated'
labels:
- 'deprecation'
- - title: 👒 Dependencies
+ - title: 📦 Dependencies
labels:
- dependencies
- title: Other Changes
From 35fcd30cbaa6258c9a403118171b5cb658ceeec6 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Fri, 29 Dec 2023 00:16:10 -0700
Subject: [PATCH 041/153] feat: move release.yml to central repository(#29)
---
.github/release.yml | 26 +-------------------------
1 file changed, 1 insertion(+), 25 deletions(-)
diff --git a/.github/release.yml b/.github/release.yml
index d82f279..0d0b1c9 100644
--- a/.github/release.yml
+++ b/.github/release.yml
@@ -1,25 +1 @@
-# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuration-options
-
-changelog:
- exclude:
- labels:
- - ignore-for-release
- categories:
- - title: '🔥 Breaking Changes'
- labels:
- - 'breaking'
- - title: 🏕 Features
- labels:
- - 'enhancement'
- - title: '🐛 Bug Fixes'
- labels:
- - 'bug'
- - title: '👋 Deprecated'
- labels:
- - 'deprecation'
- - title: 📦 Dependencies
- labels:
- - dependencies
- - title: Other Changes
- labels:
- - "*"
+_extends: .github
From 4dcb2d3f30e8d16b4029f852635ce9d628c897e0 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Fri, 29 Dec 2023 00:19:21 -0700
Subject: [PATCH 042/153] feat: move release.yml to back to repo
This reverts commit 35fcd30cbaa6258c9a403118171b5cb658ceeec6.
---
.github/release.yml | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/.github/release.yml b/.github/release.yml
index 0d0b1c9..d82f279 100644
--- a/.github/release.yml
+++ b/.github/release.yml
@@ -1 +1,25 @@
-_extends: .github
+# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuration-options
+
+changelog:
+ exclude:
+ labels:
+ - ignore-for-release
+ categories:
+ - title: '🔥 Breaking Changes'
+ labels:
+ - 'breaking'
+ - title: 🏕 Features
+ labels:
+ - 'enhancement'
+ - title: '🐛 Bug Fixes'
+ labels:
+ - 'bug'
+ - title: '👋 Deprecated'
+ labels:
+ - 'deprecation'
+ - title: 📦 Dependencies
+ labels:
+ - dependencies
+ - title: Other Changes
+ labels:
+ - "*"
From 4b4a3c7b00cfff9cef4075cef2a1f3fc0ce0397c Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Mon, 15 Jan 2024 22:57:37 -0700
Subject: [PATCH 043/153] feat: Create release-drafter.yml (#32)
---
.github/release-drafter.yml | 1 +
.github/workflows/release-drafter.yml | 16 ++++++++++++++++
2 files changed, 17 insertions(+)
create mode 100644 .github/release-drafter.yml
create mode 100644 .github/workflows/release-drafter.yml
diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml
new file mode 100644
index 0000000..0d0b1c9
--- /dev/null
+++ b/.github/release-drafter.yml
@@ -0,0 +1 @@
+_extends: .github
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
new file mode 100644
index 0000000..d703049
--- /dev/null
+++ b/.github/workflows/release-drafter.yml
@@ -0,0 +1,16 @@
+name: Release Drafter
+
+on:
+ push:
+ branches:
+ - "main"
+ workflow_dispatch:
+
+jobs:
+ update_release_draft:
+ runs-on: ubuntu-latest
+ steps:
+ # Drafts your next Release notes as Pull Requests are merged into the default branch
+ - uses: release-drafter/release-drafter@v5
+ env:
+ GITHUB_TOKEN: ${{ secrets.COMMIT_CHECK_TOKEN }}
From a1bb76326b8382733211d8efd563739a7a95ce09 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Mon, 15 Jan 2024 23:03:20 -0700
Subject: [PATCH 044/153] chore: remove release.yml (#33)
* feat: Create release-drafter.yml
* chore: remove release.yml
---
.github/release.yml | 25 -------------------------
1 file changed, 25 deletions(-)
delete mode 100644 .github/release.yml
diff --git a/.github/release.yml b/.github/release.yml
deleted file mode 100644
index d82f279..0000000
--- a/.github/release.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuration-options
-
-changelog:
- exclude:
- labels:
- - ignore-for-release
- categories:
- - title: '🔥 Breaking Changes'
- labels:
- - 'breaking'
- - title: 🏕 Features
- labels:
- - 'enhancement'
- - title: '🐛 Bug Fixes'
- labels:
- - 'bug'
- - title: '👋 Deprecated'
- labels:
- - 'deprecation'
- - title: 📦 Dependencies
- labels:
- - dependencies
- - title: Other Changes
- labels:
- - "*"
From 4f8e615f72af6adc3ba07d77284849c5acbc3523 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 17 Jan 2024 12:07:45 +0800
Subject: [PATCH 045/153] chore(deps): bump commit-check from 0.7.0 to 0.7.1
(#34)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.7.0...v0.7.1)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 26a8eed..736ca64 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.7.0
+commit-check==0.7.1
From a4909678d539481564cc7cda60c3986aee68968e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 6 Feb 2024 08:10:23 +0800
Subject: [PATCH 046/153] chore(deps): bump release-drafter/release-drafter
from 5 to 6 (#35)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5 to 6.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5...v6)
---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/release-drafter.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
index d703049..1d51417 100644
--- a/.github/workflows/release-drafter.yml
+++ b/.github/workflows/release-drafter.yml
@@ -11,6 +11,6 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into the default branch
- - uses: release-drafter/release-drafter@v5
+ - uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.COMMIT_CHECK_TOKEN }}
From a9a07be74ea6f1f34f4681c346077769368269c7 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Sun, 10 Mar 2024 15:49:05 +0800
Subject: [PATCH 047/153] chore: change release-drafter token to GITHUB_TOKEN
---
.github/workflows/release-drafter.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
index 1d51417..1d03058 100644
--- a/.github/workflows/release-drafter.yml
+++ b/.github/workflows/release-drafter.yml
@@ -13,4 +13,4 @@ jobs:
# Drafts your next Release notes as Pull Requests are merged into the default branch
- uses: release-drafter/release-drafter@v6
env:
- GITHUB_TOKEN: ${{ secrets.COMMIT_CHECK_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOEKEN }}
From 1e395609f0768727b14ec2cae251bb01ccf79acc Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 10 Mar 2024 15:55:52 +0800
Subject: [PATCH 048/153] chore(deps): bump commit-check from 0.7.1 to 0.7.2
(#36)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.7.1 to 0.7.2.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.7.1...v0.7.2)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 736ca64..bb6327c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.7.1
+commit-check==0.7.2
From 8ddedda5aa14bbf98426cbbb4b5f38dbe071d000 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Sun, 10 Mar 2024 15:58:30 +0800
Subject: [PATCH 049/153] fix: update release-drafter.yml to fix typo
---
.github/workflows/release-drafter.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
index 1d03058..c6536f9 100644
--- a/.github/workflows/release-drafter.yml
+++ b/.github/workflows/release-drafter.yml
@@ -13,4 +13,4 @@ jobs:
# Drafts your next Release notes as Pull Requests are merged into the default branch
- uses: release-drafter/release-drafter@v6
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOEKEN }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
From e055f1418b24f9038c92c8965980b65df9300a75 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Mon, 11 Mar 2024 11:25:54 +0800
Subject: [PATCH 050/153] chore: update checkout version to v4 #37 (#38)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 771b611..54937dd 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@ jobs:
commit-check:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: commit-check/commit-check-action@v1
with:
message: true
From f35ff3503e7ca754a519c02e9b3ef86a0658eccf Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Mon, 11 Mar 2024 15:04:21 +0800
Subject: [PATCH 051/153] feat: add main.py and remove entrypoint.sh (#41)
---
action.yml | 2 +-
entrypoint.sh | 56 ----------------------------------------------
main.py | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 62 insertions(+), 57 deletions(-)
delete mode 100755 entrypoint.sh
create mode 100755 main.py
diff --git a/action.yml b/action.yml
index 4d02a9c..7a1823d 100644
--- a/action.yml
+++ b/action.yml
@@ -46,7 +46,7 @@ runs:
python3 -m pip install -r "$GITHUB_ACTION_PATH/requirements.txt"
- name: Run commit-check
shell: bash
- run: ${{ github.action_path }}/entrypoint.sh
+ run: python3 ${{ github.action_path }}/main.py
env:
MESSAGE: ${{ inputs.message }}
BRANCH: ${{ inputs.branch }}
diff --git a/entrypoint.sh b/entrypoint.sh
deleted file mode 100755
index 0523cae..0000000
--- a/entrypoint.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-set -euo pipefail
-
-ret_code=0
-
-run_commit_check(){
- args=""
- if [[ "$MESSAGE" == "true" ]]; then
- args="$args --message"
- fi
- if [[ "$BRANCH" == "true" ]]; then
- args="$args --branch"
- fi
- if [[ "$AUTHOR_NAME" == "true" ]]; then
- args="$args --author-name"
- fi
- if [[ "$AUTHOR_EMAIL" == "true" ]]; then
- args="$args --author-email"
- fi
- if [[ "$COMMIT_SIGNOFF" == "true" ]]; then
- args="$args --commit-signoff"
- fi
-
- echo "commit-check $args"
- commit-check $args > result.txt
- ret_code=$?
-}
-
-add_job_summary(){
- if [[ "$JOB_SUMMARY" == "false" ]]; then
- exit
- fi
-
- if [ -s result.txt ]; then
- # strips ANSI colors
- sed -i "s,\x1B\[[0-9;]*[a-zA-Z],,g" result.txt
- cat result.txt
- echo "### Commit-Check ❌" >> "$GITHUB_STEP_SUMMARY"
- echo '```' >> "$GITHUB_STEP_SUMMARY"
- cat result.txt >> "$GITHUB_STEP_SUMMARY"
- echo '```' >> "$GITHUB_STEP_SUMMARY"
- ret_code=1
- else
- echo "### Commit-Check ✔️" >> "$GITHUB_STEP_SUMMARY"
- ret_code=0
- fi
-}
-
-run_commit_check
-add_job_summary
-
-if [[ "$DRY_RUN" == "true" ]]; then
- ret_code=0
-fi
-
-exit $ret_code
diff --git a/main.py b/main.py
new file mode 100755
index 0000000..2b07aec
--- /dev/null
+++ b/main.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python3
+import os
+import sys
+import subprocess
+import re
+
+
+def run_commit_check() -> int:
+ args = ["--message", "--branch", "--author-name", "--author-email", "--commit-signoff"]
+ args = [arg for arg, value in zip(args, [MESSAGE, BRANCH, AUTHOR_NAME, AUTHOR_EMAIL, COMMIT_SIGNOFF]) if value == "true"]
+
+ command = ["commit-check"] + args
+ print(" ".join(command))
+ with open("result.txt", "w") as result_file:
+ result = subprocess.run(command, stdout=result_file, stderr=subprocess.PIPE, check=False)
+ return result.returncode
+
+
+def add_job_summary() -> int:
+ if JOB_SUMMARY == "false":
+ sys.exit()
+
+ if os.path.getsize("result.txt") > 0:
+ with open("result.txt", "r") as result_file:
+ result_text = re.sub(r'\x1B\[[0-9;]*[a-zA-Z]', '', result_file.read()) # Remove ANSI colors
+
+ with open(GITHUB_STEP_SUMMARY, "a") as summary_file:
+ summary_file.write("### Commit-Check ❌\n```\n")
+ summary_file.write(result_text)
+ summary_file.write("```")
+ return 1
+ else:
+ with open(GITHUB_STEP_SUMMARY, "a") as summary_file:
+ summary_file.write("### Commit-Check ✔️\n")
+ return 0
+
+
+MESSAGE = os.getenv("MESSAGE", "false")
+BRANCH = os.getenv("BRANCH", "false")
+AUTHOR_NAME = os.getenv("AUTHOR_NAME", "false")
+AUTHOR_EMAIL = os.getenv("AUTHOR_EMAIL", "false")
+COMMIT_SIGNOFF = os.getenv("COMMIT_SIGNOFF", "false")
+DRY_RUN = os.getenv("DRY_RUN", "false")
+JOB_SUMMARY = os.getenv("JOB_SUMMARY", "false")
+GITHUB_STEP_SUMMARY = os.environ["GITHUB_STEP_SUMMARY"]
+
+print(f"MESSAGE = {MESSAGE}")
+print(f"BRANCH = {BRANCH}")
+print(f"AUTHOR_NAME = {AUTHOR_NAME}")
+print(f"AUTHOR_EMAIL = {AUTHOR_EMAIL}")
+print(f"COMMIT_SIGNOFF = {COMMIT_SIGNOFF}")
+print(f"DRY_RUN = {DRY_RUN}")
+print(f"JOB_SUMMARY = {JOB_SUMMARY}\n")
+
+ret_code = run_commit_check()
+ret_code += add_job_summary() # Combine return codes
+
+if DRY_RUN == "true":
+ ret_code = 0
+
+sys.exit(ret_code)
From b3c25e1a061942364d75bc9604ccf480132185cb Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 12 Mar 2024 08:08:51 +0800
Subject: [PATCH 052/153] chore(deps): bump commit-check from 0.7.2 to 0.7.3
(#42)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.7.2 to 0.7.3.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.7.2...v0.7.3)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index bb6327c..5c0c2fb 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.7.2
+commit-check==0.7.3
From b5d2b007142cc40d5df513d0aea8f60da52c09e0 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Wed, 27 Mar 2024 11:17:23 +0800
Subject: [PATCH 053/153] feat: self test by adding ./ (#43)
---
.github/workflows/commit-check.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 408838c..9689bb3 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - uses: commit-check/commit-check-action@v1
+ - uses: ./ # self test
with:
message: true
branch: true
From 4e3acb738a7f359874cb53ba33ba3f4ea6002c39 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Wed, 27 Mar 2024 13:17:03 +0800
Subject: [PATCH 054/153] feat: add used-by badge and workflow (#44)
---
.github/workflows/used-by.yml | 27 +++++++++++++++++++++++++++
.gitignore | 1 +
README.md | 1 +
3 files changed, 29 insertions(+)
create mode 100644 .github/workflows/used-by.yml
create mode 100644 .gitignore
diff --git a/.github/workflows/used-by.yml b/.github/workflows/used-by.yml
new file mode 100644
index 0000000..ea70dc8
--- /dev/null
+++ b/.github/workflows/used-by.yml
@@ -0,0 +1,27 @@
+name: Used By
+
+on:
+ schedule:
+ # https://crontab.guru/
+ - cron: '0 9 * * 1' # At 09:00 on Monday.
+ workflow_dispatch:
+
+jobs:
+ used-by:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: shenxianpeng/used-by@v0.1.2
+ with:
+ repo: '${{ github.repository }}'
+ update-badge: 'true'
+
+ - name: Create Pull Request
+ uses: peter-evans/create-pull-request@v6
+ with:
+ add-paths: "README.md" # the file path to commit
+ commit-message: "chore: update used-by badge by github-actions[bot]"
+ title: "chore: automatically update used-by badge"
+ base: main
+ labels: skip-changelog
+ delete-branch: true
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f7275bb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+venv/
diff --git a/README.md b/README.md
index 54937dd..b655631 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From 45bba9a001281ca4f401f6e4c6ed279f9902fd41 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 9 Apr 2024 07:54:37 +0800
Subject: [PATCH 055/153] chore(deps): bump commit-check from 0.7.3 to 0.7.4
(#45)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 5c0c2fb..98ea5e9 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.7.3
+commit-check==0.7.4
From 4b0359b69adc2162c8400c927748107e0cd61f19 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Wed, 17 Apr 2024 08:50:24 -0400
Subject: [PATCH 056/153] fix: update README.md to fix used-by action failure
(#47)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index b655631..1718ec7 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From fefad96ae2d5290d8807322f60edcb6a7bd81fee Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Wed, 17 Apr 2024 21:07:26 +0800
Subject: [PATCH 057/153] fix: update used-by.yml to add permissions
---
.github/workflows/used-by.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.github/workflows/used-by.yml b/.github/workflows/used-by.yml
index ea70dc8..2774628 100644
--- a/.github/workflows/used-by.yml
+++ b/.github/workflows/used-by.yml
@@ -6,6 +6,10 @@ on:
- cron: '0 9 * * 1' # At 09:00 on Monday.
workflow_dispatch:
+permissions:
+ pull-requests: write
+ contents: write
+
jobs:
used-by:
runs-on: ubuntu-latest
From 9386a211b5e9c561fcf019999b5a52f1dc945b72 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 17 Apr 2024 21:12:18 +0800
Subject: [PATCH 058/153] chore: update used-by badge by github-actions[bot]
(#48)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 1718ec7..746f93b 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From f97b659e0b13c1beba4878210dbc39708ba08999 Mon Sep 17 00:00:00 2001
From: Peter Shen
Date: Wed, 17 Apr 2024 09:22:32 -0400
Subject: [PATCH 059/153] feat: call reuseble workflows release-drafter from
.github repo (#49)
* feat: call reuseble workflows release-drafter from .github repo
* fix: update release-drafter.yml to correct repo name
* fix: remove push event from commit-check.yml
---
.github/workflows/commit-check.yml | 1 -
.github/workflows/release-drafter.yml | 9 ++-------
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 9689bb3..967657d 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -1,7 +1,6 @@
name: Commit Check
on:
- push:
pull_request:
branches: 'main'
workflow_dispatch:
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
index c6536f9..d25c13e 100644
--- a/.github/workflows/release-drafter.yml
+++ b/.github/workflows/release-drafter.yml
@@ -7,10 +7,5 @@ on:
workflow_dispatch:
jobs:
- update_release_draft:
- runs-on: ubuntu-latest
- steps:
- # Drafts your next Release notes as Pull Requests are merged into the default branch
- - uses: release-drafter/release-drafter@v6
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ draft-release:
+ uses: commit-check/.github/.github/workflows/release-drafter.yml@main
From 9959fd28d29ab0a1421c17f709845ff9109401e2 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Tue, 30 Apr 2024 10:16:59 +0800
Subject: [PATCH 060/153] chore: update used-by badge by github-actions[bot]
(#50)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 746f93b..f771beb 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From 8faff00da4b214609dd8e5d6a032e5635ed51b96 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 7 Jun 2024 15:20:02 +0800
Subject: [PATCH 061/153] chore(deps): bump commit-check from 0.7.4 to 0.8.0
(#51)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.7.4 to 0.8.0.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.7.4...v0.8.0)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 98ea5e9..80b0de5 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.7.4
+commit-check==0.8.0
From 2ebbd35ca9bf653e715b0331a93149703ace2054 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 10 Jun 2024 21:25:55 +0800
Subject: [PATCH 062/153] chore: update used-by badge by github-actions[bot]
(#52)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f771beb..447af25 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From 6885b5f5f0b701d1814a2b7f7d6aa961157db4fe Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 15 Jul 2024 17:21:44 +0800
Subject: [PATCH 063/153] chore: update used-by badge by github-actions[bot]
(#54)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 447af25..52243dd 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From 9c5167211a7f3847abc3b5fac6048d672dd9fbe6 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 29 Jul 2024 13:58:09 +0300
Subject: [PATCH 064/153] chore: update used-by badge by github-actions[bot]
(#55)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 52243dd..9425a29 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From 9852b05c06e9b15c6b49d999e7267943a73f044c Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 5 Aug 2024 13:08:16 +0300
Subject: [PATCH 065/153] chore: update used-by badge by github-actions[bot]
(#56)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 9425a29..f9c4bd2 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From e9dff429d2db882901d8f3bc3516ce6cd95550c8 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 7 Aug 2024 06:51:04 +0300
Subject: [PATCH 066/153] chore(deps): bump commit-check from 0.8.0 to 0.8.1
(#57)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 80b0de5..1468d15 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.8.0
+commit-check==0.8.1
From bf5ea372dc2344645dfc7b8d2db87b0b657b5475 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Tue, 13 Aug 2024 17:13:11 +0300
Subject: [PATCH 067/153] chore: update used-by badge by github-actions[bot]
(#58)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f9c4bd2..c56632f 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From f29561f5c387865c480f6b46a6ab2292d8c10968 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 26 Aug 2024 14:42:25 +0300
Subject: [PATCH 068/153] chore: update used-by badge by github-actions[bot]
(#59)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index c56632f..5f95842 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From c9ea3b86dadd89acbbb1747488d1442ff5e1977e Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 9 Sep 2024 11:10:38 +0300
Subject: [PATCH 069/153] chore: update used-by badge by github-actions[bot]
(#60)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 5f95842..40b66b2 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From da70798a7fc9d0615da4a3ee849d322651b74f84 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 10 Sep 2024 10:07:41 +0300
Subject: [PATCH 070/153] chore(deps): bump peter-evans/create-pull-request
from 6 to 7 (#62)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7)
---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/used-by.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/used-by.yml b/.github/workflows/used-by.yml
index 2774628..164c8b5 100644
--- a/.github/workflows/used-by.yml
+++ b/.github/workflows/used-by.yml
@@ -21,7 +21,7 @@ jobs:
update-badge: 'true'
- name: Create Pull Request
- uses: peter-evans/create-pull-request@v6
+ uses: peter-evans/create-pull-request@v7
with:
add-paths: "README.md" # the file path to commit
commit-message: "chore: update used-by badge by github-actions[bot]"
From 6d4827bde6819a533f068c8053415f0f5c09bea0 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Wed, 11 Sep 2024 10:32:37 +0300
Subject: [PATCH 071/153] docs: update README.md (#63)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 40b66b2..d2f7836 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ jobs:
### `branch`
- **Description**: check git branch naming convention.
- - By default follow bitbucket [branching model](https://support.atlassian.com/bitbucket-cloud/docs/configure-a-projects-branching-model/).
+ - By default follow bitbucket [conventional branch](https://conventional-branch.github.io/en/posts/).
- Default: 'true'
### `author-name`
From f30090e9a9835fdc38403f54d322f7e6655dfa89 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Thu, 12 Sep 2024 16:29:49 +0300
Subject: [PATCH 072/153] docs: update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index d2f7836..13d88bb 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ jobs:
### `branch`
- **Description**: check git branch naming convention.
- - By default follow bitbucket [conventional branch](https://conventional-branch.github.io/en/posts/).
+ - By default follow bitbucket [conventional branch](https://conventional-branch.github.io/posts/).
- Default: 'true'
### `author-name`
From 66d01e92ce51d0d10d21796c88ee0f27bdddf38a Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Fri, 13 Sep 2024 13:32:38 +0300
Subject: [PATCH 073/153] docs: update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 13d88bb..2fddcf5 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ jobs:
### `branch`
- **Description**: check git branch naming convention.
- - By default follow bitbucket [conventional branch](https://conventional-branch.github.io/posts/).
+ - By default follow bitbucket [conventional branch](https://conventional-branch.github.io/).
- Default: 'true'
### `author-name`
From e33ab58ca44694ee6fb249a559663abfe6dc192c Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 26 Sep 2024 17:06:28 +0300
Subject: [PATCH 074/153] chore(deps): bump commit-check from 0.8.1 to 0.8.2
(#64)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.8.1 to 0.8.2.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.8.1...v0.8.2)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 1468d15..cf993b3 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.8.1
+commit-check==0.8.2
From 1cb64d4f6c07aa4f2a44cce99afd9b605eb9c58d Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 5 Oct 2024 04:09:28 +0300
Subject: [PATCH 075/153] chore(deps): bump commit-check from 0.8.2 to 0.8.3
(#65)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index cf993b3..cd2611c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.8.2
+commit-check==0.8.3
From 037db85508e773b7939080f16a518d6f294c9e45 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 7 Oct 2024 13:45:57 +0300
Subject: [PATCH 076/153] chore: update used-by badge by github-actions[bot]
(#61)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 2fddcf5..426ff0e 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From af46d575ede7e889ca620fa8f8230ec08b50b24b Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Mon, 14 Oct 2024 11:05:58 +0300
Subject: [PATCH 077/153] fix: use virtual environment to adopt PEP 668 (#67)
* use virtual environment
* fix: FileNotFoundError of commit-check
* fix: merge two step to one step
---
action.yml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/action.yml b/action.yml
index 7a1823d..833ba66 100644
--- a/action.yml
+++ b/action.yml
@@ -36,17 +36,17 @@ inputs:
runs:
using: "composite"
steps:
- - name: Install action dependencies
+ - name: Install dependencies and run commit-check
shell: bash
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
# https://github.com/pypa/setuptools/issues/3269
export DEB_PYTHON_INSTALL_LAYOUT=deb
fi
+ python3 -m venv venv
+ source venv/bin/activate
python3 -m pip install -r "$GITHUB_ACTION_PATH/requirements.txt"
- - name: Run commit-check
- shell: bash
- run: python3 ${{ github.action_path }}/main.py
+ python3 "$GITHUB_ACTION_PATH/main.py"
env:
MESSAGE: ${{ inputs.message }}
BRANCH: ${{ inputs.branch }}
From d8abd675904f08e4c654c2617bf3915775f917cb Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 15 Oct 2024 11:13:59 +0300
Subject: [PATCH 078/153] chore(deps): bump shenxianpeng/used-by from 0.1.2 to
0.1.3 (#68)
Bumps [shenxianpeng/used-by](https://github.com/shenxianpeng/used-by) from 0.1.2 to 0.1.3.
- [Release notes](https://github.com/shenxianpeng/used-by/releases)
- [Commits](https://github.com/shenxianpeng/used-by/compare/v0.1.2...v0.1.3)
---
updated-dependencies:
- dependency-name: shenxianpeng/used-by
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/used-by.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/used-by.yml b/.github/workflows/used-by.yml
index 164c8b5..676634d 100644
--- a/.github/workflows/used-by.yml
+++ b/.github/workflows/used-by.yml
@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - uses: shenxianpeng/used-by@v0.1.2
+ - uses: shenxianpeng/used-by@v0.1.3
with:
repo: '${{ github.repository }}'
update-badge: 'true'
From a64fe4902507fb833d5f0a2eaaeb7c31bd022450 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 15 Oct 2024 12:11:49 +0300
Subject: [PATCH 079/153] chore(deps): bump shenxianpeng/used-by from 0.1.3 to
0.1.4 (#69)
Bumps [shenxianpeng/used-by](https://github.com/shenxianpeng/used-by) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/shenxianpeng/used-by/releases)
- [Commits](https://github.com/shenxianpeng/used-by/compare/v0.1.3...v0.1.4)
---
updated-dependencies:
- dependency-name: shenxianpeng/used-by
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/used-by.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/used-by.yml b/.github/workflows/used-by.yml
index 676634d..0625b49 100644
--- a/.github/workflows/used-by.yml
+++ b/.github/workflows/used-by.yml
@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - uses: shenxianpeng/used-by@v0.1.3
+ - uses: shenxianpeng/used-by@v0.1.4
with:
repo: '${{ github.repository }}'
update-badge: 'true'
From f0c526962623d29d5ec7875379eacb9c445aa06b Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Sat, 19 Oct 2024 10:54:48 +0300
Subject: [PATCH 080/153] fix: Checkout PR HEAD commit instead of merge commit
(#72)
* update .gitignore file
* fix: Update commit-check.yml
---
.github/workflows/commit-check.yml | 2 ++
.gitignore | 1 +
2 files changed, 3 insertions(+)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 967657d..96d775a 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -10,6 +10,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
- uses: ./ # self test
with:
message: true
diff --git a/.gitignore b/.gitignore
index f7275bb..43f4b6f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
venv/
+.venv/
From 785d02ea79d4e5562869d50f056cd7075187f624 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Tue, 22 Oct 2024 22:43:32 +0300
Subject: [PATCH 081/153] feat: Support posting pull request comments (#71)
* feat: support add pull request comments
* add .pre-commit-config.yaml to format code
* fix: requirements.txt and test new input
* fix: just checking PR_COMMENTS
* feat: add GITHUB_TOKEN
* update readme.md
* update exiting comments or delete it to add new one
* try to fix 'Issue' object has no attribute 'get_issue_comments'
* update .commit-check.yml
* try to fix posting issue comment
* docs: update readme
* docs: update links
---
.commit-check.yml | 12 +-
.github/workflows/commit-check.yml | 3 +
.pre-commit-config.yaml | 28 +++++
README.md | 30 ++++-
action.yml | 7 +-
main.py | 182 +++++++++++++++++++++++------
requirements.txt | 2 +
7 files changed, 218 insertions(+), 46 deletions(-)
create mode 100644 .pre-commit-config.yaml
diff --git a/.commit-check.yml b/.commit-check.yml
index bfabe35..15ac7e4 100644
--- a/.commit-check.yml
+++ b/.commit-check.yml
@@ -7,19 +7,19 @@ checks:
[optional body]\n
[optional footer(s)]\n\n
More details please refer to https://www.conventionalcommits.org"
- suggest: git commit --amend --no-verify
+ suggest: please check your commit message whether matches above regex
- check: branch
- regex: ^(bugfix|feature|release|hotfix|task|dependabot)\/.+|(master)|(main)|(HEAD)|(PR-.+)
- error: "Branches must begin with these types: bugfix/ feature/ release/ hotfix/ task/"
- suggest: git checkout -b type/branch_name
+ regex: ^(bugfix|feature|release|hotfix|task|chore)\/.+|(master)|(main)|(HEAD)|(PR-.+)
+ error: "Branches must begin with these types: bugfix/ feature/ release/ hotfix/ task/ chore/"
+ suggest: run command `git checkout -b type/branch_name`
- check: author_name
regex: ^[A-Za-z ,.\'-]+$|.*(\[bot])
error: The committer name seems invalid
- suggest: git config user.name "Peter Shen"
+ suggest: run command `git config user.name "Your Name"`
- check: author_email
regex: ^\S+@\S+\.\S+$
error: The committer email seems invalid
- suggest: git config user.email petershen@example.com
+ suggest: run command `git config user.email yourname@example.com`
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 96d775a..ecea18c 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -13,6 +13,8 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: ./ # self test
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # used by `pr-comments`
with:
message: true
branch: true
@@ -20,3 +22,4 @@ jobs:
author-email: true
commit-signoff: true
job-summary: true
+ pr-comments: true
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..b45ec09
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,28 @@
+# https://pre-commit.com/
+ci:
+ autofix_commit_msg: 'ci: auto fixes from pre-commit.com hooks'
+ autoupdate_commit_msg: 'ci: pre-commit autoupdate'
+
+repos:
+- repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v5.0.0
+ hooks:
+ - id: check-yaml
+ - id: check-toml
+ - id: end-of-file-fixer
+ - id: trailing-whitespace
+ - id: name-tests-test
+ - id: requirements-txt-fixer
+- repo: https://github.com/psf/black-pre-commit-mirror
+ rev: 24.10.0
+ hooks:
+ - id: black
+# FIXME: main.py:109: error: Item "None" of "str | None" has no attribute "split" [union-attr]
+# - repo: https://github.com/pre-commit/mirrors-mypy
+# rev: v1.12.0
+# hooks:
+# - id: mypy
+- repo: https://github.com/codespell-project/codespell
+ rev: v2.3.0
+ hooks:
+ - id: codespell
diff --git a/README.md b/README.md
index 426ff0e..c9a2679 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.pull_request.head.sha }} # Checkout PR HEAD commit
- uses: commit-check/commit-check-action@v1
with:
message: true
@@ -34,6 +36,7 @@ jobs:
commit-signoff: true
dry-run: true
job-summary: true
+ pr-comments: true
```
## Optional Inputs
@@ -72,22 +75,41 @@ jobs:
### `job-summary`
-- **Description**: display job summary to a workflow run
+- **Description**: display job summary to the workflow run
- Default: 'true'
+### `pr-comments`
+
+- **Description**: post results to the pull request comments
+- Default: 'true'
+
+> [!IMPORTANT]
+> This is a experimental feature
+> use it you need to set `GITHUB_TOKEN` in the GitHub Action.
+
Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check/blob/main/.commit-check.yml), if you want to customize just add your `.commit-check.yml` config file under your repository root directory.
## GitHub Action job summary
-By default, commit-check-action results are shown on the job summary page of the workflow.
+By default, commit-check-action results are shown on the job summary page of the workflow.
### Success job summary
-
+
### Failure job summary
-
+
+
+## GitHub Pull Request comments
+
+### Success pull request comment
+
+
+
+### Failure pull request comment
+
+
## Badging your repository
diff --git a/action.yml b/action.yml
index 833ba66..804f81c 100644
--- a/action.yml
+++ b/action.yml
@@ -30,7 +30,11 @@ inputs:
required: false
default: false
job-summary:
- description: add a job summary
+ description: display job summary to the workflow run
+ required: false
+ default: true
+ pr-comments:
+ description: post results to the pull request comments
required: false
default: true
runs:
@@ -55,3 +59,4 @@ runs:
COMMIT_SIGNOFF: ${{ inputs.commit-signoff }}
DRY_RUN: ${{ inputs.dry-run }}
JOB_SUMMARY: ${{ inputs.job-summary }}
+ PR_COMMENTS: ${{ inputs.pr-comments }}
diff --git a/main.py b/main.py
index 2b07aec..eb0af9c 100755
--- a/main.py
+++ b/main.py
@@ -3,59 +3,171 @@
import sys
import subprocess
import re
+from github import Github
+
+
+# Constants for message titles
+SUCCESS_TITLE = "# Commit-Check ✔️"
+FAILURE_TITLE = "# Commit-Check ❌"
+
+# Environment variables
+MESSAGE = os.getenv("MESSAGE", "false")
+BRANCH = os.getenv("BRANCH", "false")
+AUTHOR_NAME = os.getenv("AUTHOR_NAME", "false")
+AUTHOR_EMAIL = os.getenv("AUTHOR_EMAIL", "false")
+COMMIT_SIGNOFF = os.getenv("COMMIT_SIGNOFF", "false")
+DRY_RUN = os.getenv("DRY_RUN", "false")
+JOB_SUMMARY = os.getenv("JOB_SUMMARY", "false")
+PR_COMMENTS = os.getenv("PR_COMMENTS", "false")
+GITHUB_STEP_SUMMARY = os.environ["GITHUB_STEP_SUMMARY"]
+GITHUB_TOKEN = os.getenv("GITHUB_TOKEN")
+GITHUB_REPOSITORY = os.getenv("GITHUB_REPOSITORY")
+GITHUB_REF = os.getenv("GITHUB_REF")
+
+
+def log_env_vars():
+ """Logs the environment variables for debugging purposes."""
+ print(f"MESSAGE = {MESSAGE}")
+ print(f"BRANCH = {BRANCH}")
+ print(f"AUTHOR_NAME = {AUTHOR_NAME}")
+ print(f"AUTHOR_EMAIL = {AUTHOR_EMAIL}")
+ print(f"COMMIT_SIGNOFF = {COMMIT_SIGNOFF}")
+ print(f"DRY_RUN = {DRY_RUN}")
+ print(f"JOB_SUMMARY = {JOB_SUMMARY}")
+ print(f"PR_COMMENTS = {PR_COMMENTS}\n")
def run_commit_check() -> int:
- args = ["--message", "--branch", "--author-name", "--author-email", "--commit-signoff"]
- args = [arg for arg, value in zip(args, [MESSAGE, BRANCH, AUTHOR_NAME, AUTHOR_EMAIL, COMMIT_SIGNOFF]) if value == "true"]
+ """Runs the commit-check command and logs the result."""
+ args = [
+ "--message",
+ "--branch",
+ "--author-name",
+ "--author-email",
+ "--commit-signoff",
+ ]
+ args = [
+ arg
+ for arg, value in zip(
+ args, [MESSAGE, BRANCH, AUTHOR_NAME, AUTHOR_EMAIL, COMMIT_SIGNOFF]
+ )
+ if value == "true"
+ ]
command = ["commit-check"] + args
print(" ".join(command))
with open("result.txt", "w") as result_file:
- result = subprocess.run(command, stdout=result_file, stderr=subprocess.PIPE, check=False)
+ result = subprocess.run(
+ command, stdout=result_file, stderr=subprocess.PIPE, check=False
+ )
return result.returncode
+def read_result_file() -> str | None:
+ """Reads the result.txt file and removes ANSI color codes."""
+ if os.path.getsize("result.txt") > 0:
+ with open("result.txt", "r") as result_file:
+ result_text = re.sub(
+ r"\x1B\[[0-9;]*[a-zA-Z]", "", result_file.read()
+ ) # Remove ANSI colors
+ return result_text.rstrip()
+ return None
+
+
def add_job_summary() -> int:
+ """Adds the commit check result to the GitHub job summary."""
if JOB_SUMMARY == "false":
- sys.exit()
+ return 0
- if os.path.getsize("result.txt") > 0:
- with open("result.txt", "r") as result_file:
- result_text = re.sub(r'\x1B\[[0-9;]*[a-zA-Z]', '', result_file.read()) # Remove ANSI colors
+ result_text = read_result_file()
- with open(GITHUB_STEP_SUMMARY, "a") as summary_file:
- summary_file.write("### Commit-Check ❌\n```\n")
- summary_file.write(result_text)
- summary_file.write("```")
- return 1
- else:
- with open(GITHUB_STEP_SUMMARY, "a") as summary_file:
- summary_file.write("### Commit-Check ✔️\n")
+ summary_content = (
+ SUCCESS_TITLE
+ if result_text is None
+ else f"{FAILURE_TITLE}\n```\n{result_text}\n```"
+ )
+
+ with open(GITHUB_STEP_SUMMARY, "a") as summary_file:
+ summary_file.write(summary_content)
+
+ return 0 if result_text is None else 1
+
+
+def add_pr_comments() -> int:
+ """Posts the commit check result as a comment on the pull request."""
+ if PR_COMMENTS == "false":
return 0
+ try:
+ token = os.getenv("GITHUB_TOKEN")
+ repo_name = os.getenv("GITHUB_REPOSITORY")
+ pr_number = os.getenv("GITHUB_REF").split("/")[-2]
-MESSAGE = os.getenv("MESSAGE", "false")
-BRANCH = os.getenv("BRANCH", "false")
-AUTHOR_NAME = os.getenv("AUTHOR_NAME", "false")
-AUTHOR_EMAIL = os.getenv("AUTHOR_EMAIL", "false")
-COMMIT_SIGNOFF = os.getenv("COMMIT_SIGNOFF", "false")
-DRY_RUN = os.getenv("DRY_RUN", "false")
-JOB_SUMMARY = os.getenv("JOB_SUMMARY", "false")
-GITHUB_STEP_SUMMARY = os.environ["GITHUB_STEP_SUMMARY"]
+ # Initialize GitHub client
+ g = Github(token)
+ repo = g.get_repo(repo_name)
+ pull_request = repo.get_issue(int(pr_number))
+
+ # Prepare comment content
+ result_text = read_result_file()
+ pr_comments = (
+ SUCCESS_TITLE
+ if result_text is None
+ else f"{FAILURE_TITLE}\n```\n{result_text}\n```"
+ )
+
+ # Fetch all existing comments on the PR
+ comments = pull_request.get_comments()
+
+ # Track if we found a matching comment
+ matching_comments = []
+ last_comment = None
+
+ for comment in comments:
+ if comment.body.startswith(SUCCESS_TITLE) or comment.body.startswith(
+ FAILURE_TITLE
+ ):
+ matching_comments.append(comment)
+ if matching_comments:
+ last_comment = matching_comments[-1]
+
+ if last_comment.body == pr_comments:
+ print(f"PR comment already up-to-date for PR #{pr_number}.")
+ return 0
+ else:
+ # If the last comment doesn't match, update it
+ print(f"Updating the last comment on PR #{pr_number}.")
+ last_comment.edit(pr_comments)
+
+ # Delete all older matching comments
+ for comment in matching_comments[:-1]:
+ print(f"Deleting an old comment on PR #{pr_number}.")
+ comment.delete()
+ else:
+ # No matching comments, create a new one
+ print(f"Creating a new comment on PR #{pr_number}.")
+ pull_request.create_comment(body=pr_comments)
+
+ return 0 if result_text is None else 1
+ except Exception as e:
+ print(f"Error posting PR comment: {e}", file=sys.stderr)
+ return 1
+
+
+def main():
+ """Main function to run commit-check, add job summary and post PR comments."""
+ log_env_vars()
+
+ # Combine return codes
+ ret_code = run_commit_check()
+ ret_code += add_job_summary()
+ ret_code += add_pr_comments()
-print(f"MESSAGE = {MESSAGE}")
-print(f"BRANCH = {BRANCH}")
-print(f"AUTHOR_NAME = {AUTHOR_NAME}")
-print(f"AUTHOR_EMAIL = {AUTHOR_EMAIL}")
-print(f"COMMIT_SIGNOFF = {COMMIT_SIGNOFF}")
-print(f"DRY_RUN = {DRY_RUN}")
-print(f"JOB_SUMMARY = {JOB_SUMMARY}\n")
+ if DRY_RUN == "true":
+ ret_code = 0
-ret_code = run_commit_check()
-ret_code += add_job_summary() # Combine return codes
+ sys.exit(ret_code)
-if DRY_RUN == "true":
- ret_code = 0
-sys.exit(ret_code)
+if __name__ == "__main__":
+ main()
diff --git a/requirements.txt b/requirements.txt
index cd2611c..8a6ff3f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
commit-check==0.8.3
+# Interact with the GitHub API.
+PyGithub==2.4.0
From 8dd06d69cc6ab29926e827814ad389592f90a048 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 28 Oct 2024 22:33:28 +0200
Subject: [PATCH 082/153] chore(deps): bump commit-check from 0.8.3 to 0.8.4
(#73)
* chore(deps): bump commit-check from 0.8.3 to 0.8.4
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.8.3 to 0.8.4.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.8.3...v0.8.4)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
* fix: add permissions for pr-comments
---------
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: shenxianpeng
---
.github/workflows/commit-check.yml | 5 +++++
requirements.txt | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index ecea18c..3b939d2 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -5,6 +5,11 @@ on:
branches: 'main'
workflow_dispatch:
+permissions:
+ contents: write
+ pull-requests: write
+ repository-projects: write
+
jobs:
commit-check:
runs-on: ubuntu-latest
diff --git a/requirements.txt b/requirements.txt
index 8a6ff3f..5fa521b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.8.3
+commit-check==0.8.4
# Interact with the GitHub API.
PyGithub==2.4.0
From ef290751b8cff84a1e2f20ce9a983f339c765bdc Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Tue, 29 Oct 2024 10:46:23 +0200
Subject: [PATCH 083/153] chore: update commit-check.yml (#76)
---
.github/workflows/commit-check.yml | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 3b939d2..422d944 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -5,14 +5,13 @@ on:
branches: 'main'
workflow_dispatch:
-permissions:
- contents: write
- pull-requests: write
- repository-projects: write
-
jobs:
commit-check:
runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ pull-requests: write
+ repository-projects: write
steps:
- uses: actions/checkout@v4
with:
@@ -27,4 +26,4 @@ jobs:
author-email: true
commit-signoff: true
job-summary: true
- pr-comments: true
+ pr-comments: ${{ github.event_name == 'pull_request' }}
From 1ccc4e4dc575bb3a6ae804265be202238c65827e Mon Sep 17 00:00:00 2001
From: Randolph Sapp
Date: Tue, 29 Oct 2024 05:12:16 -0500
Subject: [PATCH 084/153] doc(example): set permissions and only post on pr
(#75)
Update the example so it only attempts to post comments on the PR action
and set the permissions fields to the minimum values required to leave
comments on PRs.
Signed-off-by: Randolph Sapp
Co-authored-by: shenxianpeng
---
README.md | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c9a2679..1646fb9 100644
--- a/README.md
+++ b/README.md
@@ -23,20 +23,25 @@ on:
jobs:
commit-check:
runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ issues: write
+ pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }} # Checkout PR HEAD commit
- uses: commit-check/commit-check-action@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: true
branch: true
author-name: true
author-email: true
commit-signoff: true
- dry-run: true
job-summary: true
- pr-comments: true
+ pr-comments: ${{ github.event_name == 'pull_request' }}
```
## Optional Inputs
From 527965ea82d62b19b6708770725863adcf266cf0 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Tue, 29 Oct 2024 15:03:16 +0200
Subject: [PATCH 085/153] chore: update commit-check.yml (#79)
* chore: update commit-check.yml
* feat: update reamde and commit-check config file
* fix: test self
---
.commit-check.yml | 2 +-
.github/workflows/commit-check.yml | 9 ++++-----
README.md | 7 +++----
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/.commit-check.yml b/.commit-check.yml
index 15ac7e4..7d5e579 100644
--- a/.commit-check.yml
+++ b/.commit-check.yml
@@ -20,6 +20,6 @@ checks:
suggest: run command `git config user.name "Your Name"`
- check: author_email
- regex: ^\S+@\S+\.\S+$
+ regex: ^.+@.+$
error: The committer email seems invalid
suggest: run command `git config user.email yourname@example.com`
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 422d944..7ee0be4 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -8,17 +8,16 @@ on:
jobs:
commit-check:
runs-on: ubuntu-latest
- permissions:
+ permissions: # use permissions because of use pr-comments
contents: read
pull-requests: write
- repository-projects: write
steps:
- uses: actions/checkout@v4
with:
- ref: ${{ github.event.pull_request.head.sha }}
- - uses: ./ # self test
+ ref: ${{ github.event.pull_request.head.sha }} # checkout PR HEAD commit
+ - uses: ./ # self test
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # used by `pr-comments`
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because of use pr-comments
with:
message: true
branch: true
diff --git a/README.md b/README.md
index 1646fb9..c9a5963 100644
--- a/README.md
+++ b/README.md
@@ -23,17 +23,16 @@ on:
jobs:
commit-check:
runs-on: ubuntu-latest
- permissions:
+ permissions: # use permissions because of use pr-comments
contents: read
- issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
- ref: ${{ github.event.pull_request.head.sha }} # Checkout PR HEAD commit
+ ref: ${{ github.event.pull_request.head.sha }} # checkout PR HEAD commit
- uses: commit-check/commit-check-action@v1
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because of use pr-comments
with:
message: true
branch: true
From f87ca4d9034aecb097d022720b200ab1765d2a28 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 29 Oct 2024 15:07:41 +0200
Subject: [PATCH 086/153] chore(deps): bump commit-check from 0.8.4 to 0.8.5
(#80)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.8.4 to 0.8.5.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.8.4...v0.8.5)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 5fa521b..7025a47 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.8.4
+commit-check==0.8.5
# Interact with the GitHub API.
PyGithub==2.4.0
From 14da7f5170215cd6cfe498671092de1f37cb1058 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Tue, 5 Nov 2024 11:16:33 +0200
Subject: [PATCH 087/153] chore: update used-by badge by github-actions[bot]
(#81)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index c9a5963..53146a8 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From 7102c90fccf978fb1c7a0eed5f5456d99223530c Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 7 Nov 2024 04:07:22 +0200
Subject: [PATCH 088/153] chore(deps): bump pygithub from 2.4.0 to 2.5.0 (#82)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 7025a47..b24952d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,4 +2,4 @@
# For details please see: https://github.com/commit-check/commit-check
commit-check==0.8.5
# Interact with the GitHub API.
-PyGithub==2.4.0
+PyGithub==2.5.0
From e7138ee3e786dbbed0aed33b925b4fef56b4bbd7 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Tue, 12 Nov 2024 00:01:53 +0200
Subject: [PATCH 089/153] chore: change `pr-comments` default to `false` and
README.md (#83)
* docs: update README.md
* docs: Update README.md
* chore: change pr-comments default value to false
---
README.md | 11 ++++++-----
action.yml | 2 +-
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index 53146a8..e58e79c 100644
--- a/README.md
+++ b/README.md
@@ -85,11 +85,12 @@ jobs:
### `pr-comments`
- **Description**: post results to the pull request comments
-- Default: 'true'
+- Default: 'false'
> [!IMPORTANT]
-> This is a experimental feature
-> use it you need to set `GITHUB_TOKEN` in the GitHub Action.
+> `pr-comments` is an experimental feature. To use it you need to set `GITHUB_TOKEN` in the GitHub Action.
+>
+> This feature currently doesn’t work with forked repositories. For more details, refer to issue [#77](https://github.com/commit-check/commit-check-action/issues/77)
Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check/blob/main/.commit-check.yml), if you want to customize just add your `.commit-check.yml` config file under your repository root directory.
@@ -117,7 +118,7 @@ By default, commit-check-action results are shown on the job summary page of the
## Badging your repository
-You can add a badge to your repository to show your contributors / users that you use commit-check!
+You can add a badge to your repository to show your contributors/users that you use commit-check!
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)
@@ -140,6 +141,6 @@ reStructuredText
Versioning follows [Semantic Versioning](https://semver.org/).
-## Have question or feedback?
+## Have questions or feedback?
To provide feedback (requesting a feature or reporting a bug) please post to [issues](https://github.com/commit-check/commit-check/issues).
diff --git a/action.yml b/action.yml
index 804f81c..531acb4 100644
--- a/action.yml
+++ b/action.yml
@@ -36,7 +36,7 @@ inputs:
pr-comments:
description: post results to the pull request comments
required: false
- default: true
+ default: false
runs:
using: "composite"
steps:
From 92872c16f71e695fce71caf21acc9a4036e67252 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 12 Nov 2024 11:31:45 +0200
Subject: [PATCH 090/153] chore(deps): bump commit-check from 0.8.5 to 0.9.0
(#84)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.8.5 to 0.9.0.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.8.5...v0.9.0)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index b24952d..6a6deae 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.8.5
+commit-check==0.9.0
# Interact with the GitHub API.
PyGithub==2.5.0
From cedb118b3582243c813f767bb2c9195c85d27187 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 12 Nov 2024 20:29:49 +0200
Subject: [PATCH 091/153] chore(deps): bump commit-check from 0.9.0 to 0.9.1
(#87)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.9.0...v0.9.1)
---
updated-dependencies:
- dependency-name: commit-check
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 6a6deae..e13f4c3 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.9.0
+commit-check==0.9.1
# Interact with the GitHub API.
PyGithub==2.5.0
From 8d507e12899a9feb405c3ed546252ff9508724e0 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Tue, 12 Nov 2024 20:36:06 +0200
Subject: [PATCH 092/153] feat: support `merge-base` input (#86)
* feat: add a empty commit to main for testing
* feat: support merge-base option #85
* test: update commit-check.yml to debug
* test: checkout all branches and tags
* feat: add a empty commit to main for testing
* docs: update readme
* test: update merge_base regex
* fix: update .commit-check.yml
* docs: update README.md
---
.commit-check.yml | 5 +++++
.github/workflows/commit-check.yml | 2 ++
README.md | 26 +++++++++++++++++++-------
action.yml | 5 +++++
main.py | 5 ++++-
5 files changed, 35 insertions(+), 8 deletions(-)
diff --git a/.commit-check.yml b/.commit-check.yml
index 7d5e579..35052d6 100644
--- a/.commit-check.yml
+++ b/.commit-check.yml
@@ -23,3 +23,8 @@ checks:
regex: ^.+@.+$
error: The committer email seems invalid
suggest: run command `git config user.email yourname@example.com`
+
+ - check: merge_base
+ regex: main # it can be master, develop, devel etc based on your project.
+ error: Current branch is not rebased onto target branch
+ suggest: please ensure your branch is rebased with the target branch
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 7ee0be4..dc398fd 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -15,6 +15,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }} # checkout PR HEAD commit
+ fetch-depth: 0 # fetch all history for all branches and tags
- uses: ./ # self test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because of use pr-comments
@@ -24,5 +25,6 @@ jobs:
author-name: true
author-email: true
commit-signoff: true
+ merge-base: true
job-summary: true
pr-comments: ${{ github.event_name == 'pull_request' }}
diff --git a/README.md b/README.md
index e58e79c..a25d56f 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }} # checkout PR HEAD commit
+ fetch-depth: 0 # required for merge-base check
- uses: commit-check/commit-check-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because of use pr-comments
@@ -39,6 +40,7 @@ jobs:
author-name: true
author-email: true
commit-signoff: true
+ merge-base: false
job-summary: true
pr-comments: ${{ github.event_name == 'pull_request' }}
```
@@ -59,19 +61,29 @@ jobs:
### `author-name`
-- **Description**: check committer author name
+- **Description**: check committer author name.
- Default: 'true'
### `author-email`
-- **Description**: check committer author email
+- **Description**: check committer author email.
- Default: 'true'
### `commit-signoff`
-- **Description**: check committer commit signature
+- **Description**: check committer commit signature.
- Default: 'true'
+### `merge-base`
+
+- **Description**: check current branch is rebased onto target branch.
+- Default: 'false'
+
+> [!IMPORTANT]
+> `merge-base` is an experimental feature. by default it's disable.
+>
+> To use this feature, you need fetch all history for all branches by setting `fetch-depth: 0` in `actions/checkout`.
+
### `dry-run`
- **Description**: run checks without failing. exit code is 0 otherwise is 1.
@@ -79,18 +91,18 @@ jobs:
### `job-summary`
-- **Description**: display job summary to the workflow run
+- **Description**: display job summary to the workflow run.
- Default: 'true'
### `pr-comments`
-- **Description**: post results to the pull request comments
+- **Description**: post results to the pull request comments.
- Default: 'false'
> [!IMPORTANT]
-> `pr-comments` is an experimental feature. To use it you need to set `GITHUB_TOKEN` in the GitHub Action.
+> `pr-comments` is an experimental feature. by default it's disable. To use it you need to set `GITHUB_TOKEN` in the GitHub Action.
>
-> This feature currently doesn’t work with forked repositories. For more details, refer to issue [#77](https://github.com/commit-check/commit-check-action/issues/77)
+> This feature currently doesn’t work with forked repositories. For more details, refer to issue [#77](https://github.com/commit-check/commit-check-action/issues/77).
Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check/blob/main/.commit-check.yml), if you want to customize just add your `.commit-check.yml` config file under your repository root directory.
diff --git a/action.yml b/action.yml
index 531acb4..d23acfc 100644
--- a/action.yml
+++ b/action.yml
@@ -25,6 +25,10 @@ inputs:
description: check committer commit signature
required: false
default: true
+ merge-base:
+ description: check current branch is rebased onto target branch
+ required: false
+ default: false
dry-run:
description: run checks without failing
required: false
@@ -57,6 +61,7 @@ runs:
AUTHOR_NAME: ${{ inputs.author-name }}
AUTHOR_EMAIL: ${{ inputs.author-email }}
COMMIT_SIGNOFF: ${{ inputs.commit-signoff }}
+ MERGE_BASE: ${{ inputs.merge-base }}
DRY_RUN: ${{ inputs.dry-run }}
JOB_SUMMARY: ${{ inputs.job-summary }}
PR_COMMENTS: ${{ inputs.pr-comments }}
diff --git a/main.py b/main.py
index eb0af9c..91d2246 100755
--- a/main.py
+++ b/main.py
@@ -16,6 +16,7 @@
AUTHOR_NAME = os.getenv("AUTHOR_NAME", "false")
AUTHOR_EMAIL = os.getenv("AUTHOR_EMAIL", "false")
COMMIT_SIGNOFF = os.getenv("COMMIT_SIGNOFF", "false")
+MERGE_BASE = os.getenv("MERGE_BASE", "false")
DRY_RUN = os.getenv("DRY_RUN", "false")
JOB_SUMMARY = os.getenv("JOB_SUMMARY", "false")
PR_COMMENTS = os.getenv("PR_COMMENTS", "false")
@@ -32,6 +33,7 @@ def log_env_vars():
print(f"AUTHOR_NAME = {AUTHOR_NAME}")
print(f"AUTHOR_EMAIL = {AUTHOR_EMAIL}")
print(f"COMMIT_SIGNOFF = {COMMIT_SIGNOFF}")
+ print(f"MERGE_BASE = {MERGE_BASE}")
print(f"DRY_RUN = {DRY_RUN}")
print(f"JOB_SUMMARY = {JOB_SUMMARY}")
print(f"PR_COMMENTS = {PR_COMMENTS}\n")
@@ -45,11 +47,12 @@ def run_commit_check() -> int:
"--author-name",
"--author-email",
"--commit-signoff",
+ "--merge-base",
]
args = [
arg
for arg, value in zip(
- args, [MESSAGE, BRANCH, AUTHOR_NAME, AUTHOR_EMAIL, COMMIT_SIGNOFF]
+ args, [MESSAGE, BRANCH, AUTHOR_NAME, AUTHOR_EMAIL, COMMIT_SIGNOFF, MERGE_BASE]
)
if value == "true"
]
From 1ab8377c687393a441c2a953413925398cbd28fe Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 15 Nov 2024 01:22:54 +0200
Subject: [PATCH 093/153] chore(deps): bump commit-check from 0.9.1 to 0.9.2
(#88)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index e13f4c3..fdcf08c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.9.1
+commit-check==0.9.2
# Interact with the GitHub API.
PyGithub==2.5.0
From 4a509ea5098fa2e24945649d9198e1aece898733 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Sun, 1 Dec 2024 21:18:21 +0200
Subject: [PATCH 094/153] docs: update readme.md (#89)
---
README.md | 41 +++++++++++++++++++++++++----------------
1 file changed, 25 insertions(+), 16 deletions(-)
diff --git a/README.md b/README.md
index a25d56f..e96d3d3 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,15 @@
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
+## Table of Contents
+
+* [Usage](#usage)
+* [Optional Inputs](#optional-inputs)
+* [GitHub Action Job Summary](#github-action-job-summary)
+* [GitHub Pull Request Comments](#github-pull-request-comments)
+* [Badging Your Repository](#badging-your-repository)
+* [Versioning](#versioning)
+
## Usage
Create a new GitHub Actions workflow in your project, e.g. at [.github/workflows/commit-check.yml](.github/workflows/commit-check.yml)
@@ -51,33 +60,33 @@ jobs:
- **Description**: check commit message formatting convention.
- By default the rule follows [conventional commits](https://www.conventionalcommits.org/).
-- Default: 'true'
+- Default: `true`
### `branch`
- **Description**: check git branch naming convention.
- By default follow bitbucket [conventional branch](https://conventional-branch.github.io/).
-- Default: 'true'
+- Default: `true`
### `author-name`
- **Description**: check committer author name.
-- Default: 'true'
+- Default: `true`
### `author-email`
- **Description**: check committer author email.
-- Default: 'true'
+- Default: `true`
### `commit-signoff`
- **Description**: check committer commit signature.
-- Default: 'true'
+- Default: `true`
### `merge-base`
- **Description**: check current branch is rebased onto target branch.
-- Default: 'false'
+- Default: `false`
> [!IMPORTANT]
> `merge-base` is an experimental feature. by default it's disable.
@@ -87,17 +96,17 @@ jobs:
### `dry-run`
- **Description**: run checks without failing. exit code is 0 otherwise is 1.
-- Default: 'false'
+- Default: `false`
### `job-summary`
- **Description**: display job summary to the workflow run.
-- Default: 'true'
+- Default: `true`
### `pr-comments`
- **Description**: post results to the pull request comments.
-- Default: 'false'
+- Default: `false`
> [!IMPORTANT]
> `pr-comments` is an experimental feature. by default it's disable. To use it you need to set `GITHUB_TOKEN` in the GitHub Action.
@@ -106,29 +115,29 @@ jobs:
Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check/blob/main/.commit-check.yml), if you want to customize just add your `.commit-check.yml` config file under your repository root directory.
-## GitHub Action job summary
+## GitHub Action Job Summary
By default, commit-check-action results are shown on the job summary page of the workflow.
-### Success job summary
+### Success Job Summary

-### Failure job summary
+### Failure Job Summary

-## GitHub Pull Request comments
+## GitHub Pull Request Comments
-### Success pull request comment
+### Success Pull Request Comment

-### Failure pull request comment
+### Failure Pull Request Comment

-## Badging your repository
+## Badging Your Repository
You can add a badge to your repository to show your contributors/users that you use commit-check!
From cd614c1cb08de72a55a5ec4aaab7f30ca9ba4d69 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Sun, 8 Dec 2024 22:23:12 +0200
Subject: [PATCH 095/153] feat: print error log in github action (#91)
* feat: print error log in github action
* feat: add pre-commit.yml
* chore: add type to function
---
.github/workflows/pre-commit.yml | 10 ++++++++++
.pre-commit-config.yaml | 9 ++++-----
README.md | 2 +-
main.py | 32 ++++++++++++++++++++++++++++----
4 files changed, 43 insertions(+), 10 deletions(-)
create mode 100644 .github/workflows/pre-commit.yml
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
new file mode 100644
index 0000000..7ee1b19
--- /dev/null
+++ b/.github/workflows/pre-commit.yml
@@ -0,0 +1,10 @@
+name: Run pre-commit
+
+on:
+ push:
+ pull_request:
+ types: opened
+
+jobs:
+ pre-commit:
+ uses: commit-check/.github/.github/workflows/pre-commit.yml@main
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index b45ec09..571d5ee 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -17,11 +17,10 @@ repos:
rev: 24.10.0
hooks:
- id: black
-# FIXME: main.py:109: error: Item "None" of "str | None" has no attribute "split" [union-attr]
-# - repo: https://github.com/pre-commit/mirrors-mypy
-# rev: v1.12.0
-# hooks:
-# - id: mypy
+- repo: https://github.com/pre-commit/mirrors-mypy
+ rev: v1.12.0
+ hooks:
+ - id: mypy
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
diff --git a/README.md b/README.md
index e96d3d3..5bd3919 100644
--- a/README.md
+++ b/README.md
@@ -90,7 +90,7 @@ jobs:
> [!IMPORTANT]
> `merge-base` is an experimental feature. by default it's disable.
->
+>
> To use this feature, you need fetch all history for all branches by setting `fetch-depth: 0` in `actions/checkout`.
### `dry-run`
diff --git a/main.py b/main.py
index 91d2246..87434ec 100755
--- a/main.py
+++ b/main.py
@@ -3,7 +3,7 @@
import sys
import subprocess
import re
-from github import Github
+from github import Github # type: ignore
# Constants for message titles
@@ -52,7 +52,8 @@ def run_commit_check() -> int:
args = [
arg
for arg, value in zip(
- args, [MESSAGE, BRANCH, AUTHOR_NAME, AUTHOR_EMAIL, COMMIT_SIGNOFF, MERGE_BASE]
+ args,
+ [MESSAGE, BRANCH, AUTHOR_NAME, AUTHOR_EMAIL, COMMIT_SIGNOFF, MERGE_BASE],
)
if value == "true"
]
@@ -104,7 +105,12 @@ def add_pr_comments() -> int:
try:
token = os.getenv("GITHUB_TOKEN")
repo_name = os.getenv("GITHUB_REPOSITORY")
- pr_number = os.getenv("GITHUB_REF").split("/")[-2]
+ pr_number = os.getenv("GITHUB_REF")
+ if pr_number is not None:
+ pr_number = pr_number.split("/")[-2]
+ else:
+ # Handle the case where GITHUB_REF is not set
+ raise ValueError("GITHUB_REF environment variable is not set")
# Initialize GitHub client
g = Github(token)
@@ -157,6 +163,23 @@ def add_pr_comments() -> int:
return 1
+def log_error_and_exit(
+ failure_title: str, result_text: str | None, ret_code: int
+) -> None:
+ """
+ Logs an error message to GitHub Actions and exits with the specified return code.
+
+ Args:
+ failure_title (str): The title of the failure message.
+ result_text (str): The detailed result text to include in the error message.
+ ret_code (int): The return code to exit with.
+ """
+ if result_text:
+ error_message = f"{failure_title}\n```\n{result_text}\n```"
+ print(f"::error::{error_message}")
+ sys.exit(ret_code)
+
+
def main():
"""Main function to run commit-check, add job summary and post PR comments."""
log_env_vars()
@@ -169,7 +192,8 @@ def main():
if DRY_RUN == "true":
ret_code = 0
- sys.exit(ret_code)
+ result_text = read_result_file()
+ log_error_and_exit(FAILURE_TITLE, result_text, ret_code)
if __name__ == "__main__":
From e0cc9e5316ee98e3e3b46587e2a5ceb1cbe0e8b8 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 23 Dec 2024 11:55:13 +0200
Subject: [PATCH 096/153] chore: update used-by badge by github-actions[bot]
(#90)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 5bd3919..904f3ff 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From a9e1fa7cfc7bf7e343d035ca39fb10d0f73f93c2 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 6 Jan 2025 11:52:03 +0200
Subject: [PATCH 097/153] chore: update used-by badge by github-actions[bot]
(#92)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 904f3ff..78bc0df 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From 7ad236da3dbc06f7366c04539fac7b1d316c7311 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Sun, 26 Jan 2025 18:06:38 +0200
Subject: [PATCH 098/153] docs: Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 78bc0df..8cf7e56 100644
--- a/README.md
+++ b/README.md
@@ -65,7 +65,7 @@ jobs:
### `branch`
- **Description**: check git branch naming convention.
- - By default follow bitbucket [conventional branch](https://conventional-branch.github.io/).
+ - By default the rule follows [conventional branch](https://conventional-branch.github.io/).
- Default: `true`
### `author-name`
From 85adfd6817121ee1d974447c148bd7c545cda55a Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 3 Feb 2025 11:39:38 +0200
Subject: [PATCH 099/153] chore(deps): bump commit-check from 0.9.2 to 0.9.3
(#96)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index fdcf08c..87cc436 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.9.2
+commit-check==0.9.3
# Interact with the GitHub API.
PyGithub==2.5.0
From e3433860d76e5ac2e085b7fba66a313197d5b404 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Thu, 6 Feb 2025 14:36:12 +0200
Subject: [PATCH 100/153] chore: update used-by badge by github-actions[bot]
(#95)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 8cf7e56..bb7c106 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From e6a901f3af3cb43def9dd8dcd864b03dc44a860e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 18 Feb 2025 15:39:46 +0800
Subject: [PATCH 101/153] chore(deps): bump pygithub from 2.5.0 to 2.6.0 (#99)
Bumps [pygithub](https://github.com/pygithub/pygithub) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/pygithub/pygithub/releases)
- [Changelog](https://github.com/PyGithub/PyGithub/blob/main/doc/changes.rst)
- [Commits](https://github.com/pygithub/pygithub/compare/v2.5.0...v2.6.0)
---
updated-dependencies:
- dependency-name: pygithub
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 87cc436..fa52544 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,4 +2,4 @@
# For details please see: https://github.com/commit-check/commit-check
commit-check==0.9.3
# Interact with the GitHub API.
-PyGithub==2.5.0
+PyGithub==2.6.0
From 3b406fc3006cde0e64a760fb50063f79027259c2 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Tue, 18 Feb 2025 15:40:37 +0800
Subject: [PATCH 102/153] chore: update used-by badge by github-actions[bot]
(#97)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index bb7c106..10a43ff 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From 59690d7fbb42eb373d0c278db60c1afe83c9b13f Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 22 Feb 2025 19:51:32 +0800
Subject: [PATCH 103/153] chore(deps): bump pygithub from 2.6.0 to 2.6.1 (#100)
Bumps [pygithub](https://github.com/pygithub/pygithub) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/pygithub/pygithub/releases)
- [Changelog](https://github.com/PyGithub/PyGithub/blob/v2.6.1/doc/changes.rst)
- [Commits](https://github.com/pygithub/pygithub/compare/v2.6.0...v2.6.1)
---
updated-dependencies:
- dependency-name: pygithub
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index fa52544..aae4bb1 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,4 +2,4 @@
# For details please see: https://github.com/commit-check/commit-check
commit-check==0.9.3
# Interact with the GitHub API.
-PyGithub==2.6.0
+PyGithub==2.6.1
From ec47d191c2a467428c72aedf8823cc609db0e767 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 24 Feb 2025 22:27:38 +0800
Subject: [PATCH 104/153] chore(deps): bump commit-check from 0.9.3 to 0.9.4
(#103)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index aae4bb1..8b903aa 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.9.3
+commit-check==0.9.4
# Interact with the GitHub API.
PyGithub==2.6.1
From cac2d49b6c81b73cefef7a842f69b872543a18dc Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Tue, 25 Feb 2025 01:54:49 +0800
Subject: [PATCH 105/153] fix: update .commit-check.yml (#104)
Ref https://github.com/commit-check/commit-check/pull/221
---
.commit-check.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.commit-check.yml b/.commit-check.yml
index 35052d6..f1f725f 100644
--- a/.commit-check.yml
+++ b/.commit-check.yml
@@ -15,7 +15,7 @@ checks:
suggest: run command `git checkout -b type/branch_name`
- check: author_name
- regex: ^[A-Za-z ,.\'-]+$|.*(\[bot])
+ regex: ^[A-Za-zÀ-ÖØ-öø-ÿ\u0100-\u017F\u0180-\u024F ,.\'-]+$|.*(\[bot])
error: The committer name seems invalid
suggest: run command `git config user.name "Your Name"`
From a14e83e435c351b6bd9a12eea2909ef75d514cf8 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Tue, 25 Feb 2025 01:57:01 +0800
Subject: [PATCH 106/153] chore: update used-by badge by github-actions[bot]
(#102)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 10a43ff..7bba6d8 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From 9a4f9d029326c8f51a0a672055300fcc2b89d6a3 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Mon, 24 Mar 2025 23:28:27 +0800
Subject: [PATCH 107/153] docs: add used-by section (#106)
* docs: add used-by section
* docs: add more logo and name
---
README.md | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/README.md b/README.md
index 7bba6d8..3a5dd8d 100644
--- a/README.md
+++ b/README.md
@@ -54,6 +54,22 @@ jobs:
pr-comments: ${{ github.event_name == 'pull_request' }}
```
+## Used By
+
+
+
+ Apache
+
+ discovery-unicamp
+
+ Texas Instruments
+
+ OpenCADC
+
+ Extrawest
+ and many more.
+
+
## Optional Inputs
### `message`
From 5ea0f66e396dda561c2db397b125c245ef3f133c Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 18:27:09 +0300
Subject: [PATCH 108/153] chore(deps): bump commit-check from 0.9.4 to 0.9.5
(#107)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.9.4 to 0.9.5.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.9.4...v0.9.5)
---
updated-dependencies:
- dependency-name: commit-check
dependency-version: 0.9.5
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 8b903aa..764bb33 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.9.4
+commit-check==0.9.5
# Interact with the GitHub API.
PyGithub==2.6.1
From 2f0715bb7ec18b41fdeab08e92a28ee3b5e3daee Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 18:31:07 +0300
Subject: [PATCH 109/153] chore: update used-by badge by github-actions[bot]
(#105)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 3a5dd8d..73693ac 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From a2873ca0482dd505c93fb51861c953e82fd0a186 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Thu, 3 Apr 2025 23:46:30 +0800
Subject: [PATCH 110/153] feat: verify commit-check artifact attestations (#53)
* Update action.yml to verify artifact attestations
* Update action.yml to add GH_TOKEN
* Update action.yml
* Update action.yml
* Update action.yml
* Update action.yml
* fix: create virtual env then verify attestations
---
action.yml | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/action.yml b/action.yml
index d23acfc..cdd75ea 100644
--- a/action.yml
+++ b/action.yml
@@ -51,9 +51,23 @@ runs:
# https://github.com/pypa/setuptools/issues/3269
export DEB_PYTHON_INSTALL_LAYOUT=deb
fi
+
+ # Set up virtual environment
python3 -m venv venv
source venv/bin/activate
- python3 -m pip install -r "$GITHUB_ACTION_PATH/requirements.txt"
+
+ # Download artifact
+ python3 -m pip download -r "$GITHUB_ACTION_PATH/requirements.txt"
+
+ # Verify artifact attestations
+ if ! gh attestation verify commit_check-*.whl -R commit-check/commit-check; then
+ echo "Artifact verification failed. Aborting installation."
+ exit 1
+ fi
+
+ # Install artifact
+ python3 -m pip install commit_check-*.whl PyGithub-*.whl
+
python3 "$GITHUB_ACTION_PATH/main.py"
env:
MESSAGE: ${{ inputs.message }}
From 188ce79aedf0bbe6bb80bdde87286b39d856a146 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Tue, 29 Apr 2025 01:49:28 +0300
Subject: [PATCH 111/153] chore: update used-by badge by github-actions[bot]
(#109)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 73693ac..b1581f8 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From 2a2720988b5dc4de387a87aa095bcd36d5477ff5 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Fri, 9 May 2025 14:02:52 +0300
Subject: [PATCH 112/153] docs: Update README.md to add more user (#110)
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index b1581f8..c402e4c 100644
--- a/README.md
+++ b/README.md
@@ -67,6 +67,8 @@ jobs:
OpenCADC
Extrawest
+
+ Chainlift
and many more.
From 6fc6f138e6cf9839ffdfd9b644e9c6ff16d18ca7 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 19 May 2025 20:42:24 +0300
Subject: [PATCH 113/153] chore: update used-by badge by github-actions[bot]
(#111)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index c402e4c..8c3955f 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From 1e0b8f60abf130034231a303f520213c7da90421 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 2 Jun 2025 01:05:57 +0300
Subject: [PATCH 114/153] chore(deps): bump commit-check from 0.9.5 to 0.9.6
(#112)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.9.5 to 0.9.6.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.9.5...v0.9.6)
---
updated-dependencies:
- dependency-name: commit-check
dependency-version: 0.9.6
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 764bb33..e16e5b7 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.9.5
+commit-check==0.9.6
# Interact with the GitHub API.
PyGithub==2.6.1
From f09ba795622b9cb0d0d5e668926235a1d893c7a4 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Mon, 2 Jun 2025 01:15:48 +0300
Subject: [PATCH 115/153] docs: update README.md to add SLSA badge (#108)
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 8c3955f..864c2a9 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,7 @@

[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
+[](https://github.com/commit-check/commit-check-action/blob/a2873ca0482dd505c93fb51861c953e82fd0a186/action.yml#L59-L69)
A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
From 3d725f7c79065a0868c1159b9620e2fdbf593070 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Mon, 9 Jun 2025 16:24:47 +0300
Subject: [PATCH 116/153] docs: update used-by section to add new user (#114)
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 864c2a9..85cb932 100644
--- a/README.md
+++ b/README.md
@@ -70,6 +70,8 @@ jobs:
Extrawest
Chainlift
+
+ Mila
and many more.
From fc071f42a0383a8293e08ee74b9790667e81b071 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 9 Jun 2025 16:25:28 +0300
Subject: [PATCH 117/153] chore: update used-by badge by github-actions[bot]
(#113)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 85cb932..9e9df7b 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
[](https://github.com/commit-check/commit-check-action/blob/a2873ca0482dd505c93fb51861c953e82fd0a186/action.yml#L59-L69)
From dc70291dfe44fc677194957824d6da0ebdbe8295 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 14 Jun 2025 09:25:31 +0300
Subject: [PATCH 118/153] chore(deps): bump commit-check from 0.9.6 to 0.9.7
(#115)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index e16e5b7..cfbca4a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.9.6
+commit-check==0.9.7
# Interact with the GitHub API.
PyGithub==2.6.1
From 1c4cee8a7be7a87cdd108eb44212d5a8d7879f25 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Sun, 22 Jun 2025 16:54:05 +0200
Subject: [PATCH 119/153] chore: update CODEOWNERS (#116)
---
.github/CODEOWNERS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 4f08a45..28f6ce8 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1 +1 @@
-* @shenxianpeng
+* @commit-check/commit-check-action-maintain
From e0573966eeb36d7d2679666dd84e8a109e608bd0 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Wed, 25 Jun 2025 10:03:10 +0300
Subject: [PATCH 120/153] chore: Update CODEOWNERS (#117)
---
.github/CODEOWNERS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 28f6ce8..37cffb1 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1 +1 @@
-* @commit-check/commit-check-action-maintain
+* @commit-check/developers
From 53d82cdf6770347091cd2dfad599e229a4e26a19 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 8 Jul 2025 09:09:29 +0300
Subject: [PATCH 121/153] chore(deps): bump commit-check from 0.9.7 to 0.9.8
(#118)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index cfbca4a..83f85af 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.9.7
+commit-check==0.9.8
# Interact with the GitHub API.
PyGithub==2.6.1
From 879c2ea00f6d1a44299d377819860b026b7c8186 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 10 Jul 2025 04:08:13 +0300
Subject: [PATCH 122/153] chore(deps): bump commit-check from 0.9.8 to 0.9.9
(#119)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 83f85af..8afa311 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.9.8
+commit-check==0.9.9
# Interact with the GitHub API.
PyGithub==2.6.1
From 3044b4a85b4acce21aa8b7baf981b815fe16a88b Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 13 Jul 2025 01:01:59 +0300
Subject: [PATCH 123/153] chore(deps): bump commit-check from 0.9.9 to 0.10.0
(#120)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.9.9 to 0.10.0.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.9.9...v0.10.0)
---
updated-dependencies:
- dependency-name: commit-check
dependency-version: 0.10.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 8afa311..f435380 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.9.9
+commit-check==0.10.0
# Interact with the GitHub API.
PyGithub==2.6.1
From 32e740233ee3e54f4f830ad31b84eaebee640808 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Sun, 13 Jul 2025 01:03:49 +0300
Subject: [PATCH 124/153] feat: add imperative mood (#121)
---
.github/workflows/commit-check.yml | 1 +
README.md | 6 ++++++
action.yml | 5 +++++
main.py | 13 ++++++++++++-
4 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index dc398fd..f75de56 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -26,5 +26,6 @@ jobs:
author-email: true
commit-signoff: true
merge-base: true
+ imperative: true
job-summary: true
pr-comments: ${{ github.event_name == 'pull_request' }}
diff --git a/README.md b/README.md
index 9e9df7b..c9dd2de 100644
--- a/README.md
+++ b/README.md
@@ -51,6 +51,7 @@ jobs:
author-email: true
commit-signoff: true
merge-base: false
+ imperative: true
job-summary: true
pr-comments: ${{ github.event_name == 'pull_request' }}
```
@@ -114,6 +115,11 @@ jobs:
>
> To use this feature, you need fetch all history for all branches by setting `fetch-depth: 0` in `actions/checkout`.
+### `imperative`
+
+- **Description**: check commit message is imperative mood.
+- Default: `true`
+
### `dry-run`
- **Description**: run checks without failing. exit code is 0 otherwise is 1.
diff --git a/action.yml b/action.yml
index cdd75ea..5f164b1 100644
--- a/action.yml
+++ b/action.yml
@@ -29,6 +29,10 @@ inputs:
description: check current branch is rebased onto target branch
required: false
default: false
+ imperative:
+ description: check commit message is in imperative mood
+ required: false
+ default: true
dry-run:
description: run checks without failing
required: false
@@ -76,6 +80,7 @@ runs:
AUTHOR_EMAIL: ${{ inputs.author-email }}
COMMIT_SIGNOFF: ${{ inputs.commit-signoff }}
MERGE_BASE: ${{ inputs.merge-base }}
+ IMPERATIVE: ${{ inputs.imperative }}
DRY_RUN: ${{ inputs.dry-run }}
JOB_SUMMARY: ${{ inputs.job-summary }}
PR_COMMENTS: ${{ inputs.pr-comments }}
diff --git a/main.py b/main.py
index 87434ec..ef9c920 100755
--- a/main.py
+++ b/main.py
@@ -17,6 +17,7 @@
AUTHOR_EMAIL = os.getenv("AUTHOR_EMAIL", "false")
COMMIT_SIGNOFF = os.getenv("COMMIT_SIGNOFF", "false")
MERGE_BASE = os.getenv("MERGE_BASE", "false")
+IMPERATIVE = os.getenv("IMPERATIVE", "true")
DRY_RUN = os.getenv("DRY_RUN", "false")
JOB_SUMMARY = os.getenv("JOB_SUMMARY", "false")
PR_COMMENTS = os.getenv("PR_COMMENTS", "false")
@@ -34,6 +35,7 @@ def log_env_vars():
print(f"AUTHOR_EMAIL = {AUTHOR_EMAIL}")
print(f"COMMIT_SIGNOFF = {COMMIT_SIGNOFF}")
print(f"MERGE_BASE = {MERGE_BASE}")
+ print(f"IMPERATIVE = {IMPERATIVE}")
print(f"DRY_RUN = {DRY_RUN}")
print(f"JOB_SUMMARY = {JOB_SUMMARY}")
print(f"PR_COMMENTS = {PR_COMMENTS}\n")
@@ -48,12 +50,21 @@ def run_commit_check() -> int:
"--author-email",
"--commit-signoff",
"--merge-base",
+ "--imperative",
]
args = [
arg
for arg, value in zip(
args,
- [MESSAGE, BRANCH, AUTHOR_NAME, AUTHOR_EMAIL, COMMIT_SIGNOFF, MERGE_BASE],
+ [
+ MESSAGE,
+ BRANCH,
+ AUTHOR_NAME,
+ AUTHOR_EMAIL,
+ COMMIT_SIGNOFF,
+ MERGE_BASE,
+ IMPERATIVE,
+ ],
)
if value == "true"
]
From 905a06612e217827396076e579317ff64d863901 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Mon, 14 Jul 2025 23:44:32 +0300
Subject: [PATCH 125/153] chore: change imperative default to false (#123)
---
README.md | 2 +-
action.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c9dd2de..848bbf0 100644
--- a/README.md
+++ b/README.md
@@ -118,7 +118,7 @@ jobs:
### `imperative`
- **Description**: check commit message is imperative mood.
-- Default: `true`
+- Default: `false`
### `dry-run`
diff --git a/action.yml b/action.yml
index 5f164b1..cd82940 100644
--- a/action.yml
+++ b/action.yml
@@ -32,7 +32,7 @@ inputs:
imperative:
description: check commit message is in imperative mood
required: false
- default: true
+ default: false
dry-run:
description: run checks without failing
required: false
From 38641d6ac4173719bca74d302f60b429ea89015c Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 14 Jul 2025 23:44:49 +0300
Subject: [PATCH 126/153] chore(deps): bump commit-check from 0.10.0 to 0.10.1
(#122)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.10.0 to 0.10.1.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.10.0...v0.10.1)
---
updated-dependencies:
- dependency-name: commit-check
dependency-version: 0.10.1
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index f435380..e5d3b5d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.10.0
+commit-check==0.10.1
# Interact with the GitHub API.
PyGithub==2.6.1
From e6d7e53cd2463d592946c8f56b0ce74c3913b567 Mon Sep 17 00:00:00 2001
From: shenxianpeng
Date: Tue, 15 Jul 2025 11:55:00 +0300
Subject: [PATCH 127/153] docs: update README.md to fix grammer (#124)
* docs: update README.md to fix gramer
* docs: update README.md
---
README.md | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/README.md b/README.md
index 848bbf0..478a8d4 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
[](https://github.com/marketplace/actions/commit-check-action)
[](https://github.com/commit-check/commit-check-action/blob/a2873ca0482dd505c93fb51861c953e82fd0a186/action.yml#L59-L69)
-A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
+A GitHub Action for checking commit message formatting, branch naming, committer name, email, commit signoff, and more.
## Table of Contents
@@ -33,7 +33,7 @@ on:
jobs:
commit-check:
runs-on: ubuntu-latest
- permissions: # use permissions because of use pr-comments
+ permissions: # use permissions because use of pr-comments
contents: read
pull-requests: write
steps:
@@ -43,7 +43,7 @@ jobs:
fetch-depth: 0 # required for merge-base check
- uses: commit-check/commit-check-action@v1
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because of use pr-comments
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because use of pr-comments
with:
message: true
branch: true
@@ -51,7 +51,7 @@ jobs:
author-email: true
commit-signoff: true
merge-base: false
- imperative: true
+ imperative: false
job-summary: true
pr-comments: ${{ github.event_name == 'pull_request' }}
```
@@ -81,13 +81,13 @@ jobs:
### `message`
- **Description**: check commit message formatting convention.
- - By default the rule follows [conventional commits](https://www.conventionalcommits.org/).
+ - By default, the rule follows [conventional commits](https://www.conventionalcommits.org/).
- Default: `true`
### `branch`
- **Description**: check git branch naming convention.
- - By default the rule follows [conventional branch](https://conventional-branch.github.io/).
+ - By default, the rule follows [conventional branch](https://conventional-branch.github.io/).
- Default: `true`
### `author-name`
@@ -107,13 +107,13 @@ jobs:
### `merge-base`
-- **Description**: check current branch is rebased onto target branch.
+- **Description**: check current branch is rebased onto the target branch.
- Default: `false`
> [!IMPORTANT]
-> `merge-base` is an experimental feature. by default it's disable.
+> `merge-base` is an experimental feature. By default, it's disabled.
>
-> To use this feature, you need fetch all history for all branches by setting `fetch-depth: 0` in `actions/checkout`.
+> To use this feature, you need to fetch all history for all branches by setting `fetch-depth: 0` in `actions/checkout`.
### `imperative`
@@ -122,7 +122,7 @@ jobs:
### `dry-run`
-- **Description**: run checks without failing. exit code is 0 otherwise is 1.
+- **Description**: run checks without failing. exit code is 0; otherwise is 1.
- Default: `false`
### `job-summary`
@@ -136,11 +136,11 @@ jobs:
- Default: `false`
> [!IMPORTANT]
-> `pr-comments` is an experimental feature. by default it's disable. To use it you need to set `GITHUB_TOKEN` in the GitHub Action.
+> `pr-comments` is an experimental feature. By default, it's disabled. To use it, you need to set `GITHUB_TOKEN` in the GitHub Action.
>
> This feature currently doesn’t work with forked repositories. For more details, refer to issue [#77](https://github.com/commit-check/commit-check-action/issues/77).
-Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check/blob/main/.commit-check.yml), if you want to customize just add your `.commit-check.yml` config file under your repository root directory.
+Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check/blob/main/.commit-check.yml). If you want to customize, just add your `.commit-check.yml` config file under your repository root directory.
## GitHub Action Job Summary
@@ -191,4 +191,4 @@ Versioning follows [Semantic Versioning](https://semver.org/).
## Have questions or feedback?
-To provide feedback (requesting a feature or reporting a bug) please post to [issues](https://github.com/commit-check/commit-check/issues).
+To provide feedback (requesting a feature or reporting a bug), please post to [issues](https://github.com/commit-check/commit-check/issues).
From 1968496411d3da2dddc6a6d891ab95eaa9b03ec6 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 1 Aug 2025 11:29:07 +0300
Subject: [PATCH 128/153] chore(deps): bump pygithub from 2.6.1 to 2.7.0 (#126)
* chore(deps): bump pygithub from 2.6.1 to 2.7.0
Bumps [pygithub](https://github.com/pygithub/pygithub) from 2.6.1 to 2.7.0.
- [Release notes](https://github.com/pygithub/pygithub/releases)
- [Changelog](https://github.com/PyGithub/PyGithub/blob/main/doc/changes.rst)
- [Commits](https://github.com/pygithub/pygithub/compare/v2.6.1...v2.7.0)
---
updated-dependencies:
- dependency-name: pygithub
dependency-version: 2.7.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
* fix: change wheel package name to pygithub
---------
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: shenxianpeng
---
action.yml | 2 +-
requirements.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/action.yml b/action.yml
index cd82940..eb12512 100644
--- a/action.yml
+++ b/action.yml
@@ -70,7 +70,7 @@ runs:
fi
# Install artifact
- python3 -m pip install commit_check-*.whl PyGithub-*.whl
+ python3 -m pip install commit_check-*.whl pygithub-*.whl
python3 "$GITHUB_ACTION_PATH/main.py"
env:
diff --git a/requirements.txt b/requirements.txt
index e5d3b5d..e5ff28b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,4 +2,4 @@
# For details please see: https://github.com/commit-check/commit-check
commit-check==0.10.1
# Interact with the GitHub API.
-PyGithub==2.6.1
+PyGithub==2.7.0
From 77cf05a832a41bb8c2749a300aaea3fa31c65479 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 12 Aug 2025 11:11:58 +0300
Subject: [PATCH 129/153] chore(deps): bump actions/checkout from 4 to 5 (#127)
---
.github/workflows/commit-check.yml | 2 +-
.github/workflows/main.yaml | 2 +-
.github/workflows/used-by.yml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index f75de56..b22e048 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -12,7 +12,7 @@ jobs:
contents: read
pull-requests: write
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }} # checkout PR HEAD commit
fetch-depth: 0 # fetch all history for all branches and tags
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index 913593d..b4a7f0d 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -19,7 +19,7 @@ jobs:
re-tag:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
with:
fetch-depth: 0
ref: ${{ inputs.ref }}
diff --git a/.github/workflows/used-by.yml b/.github/workflows/used-by.yml
index 0625b49..fae6e88 100644
--- a/.github/workflows/used-by.yml
+++ b/.github/workflows/used-by.yml
@@ -14,7 +14,7 @@ jobs:
used-by:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
- uses: shenxianpeng/used-by@v0.1.4
with:
repo: '${{ github.repository }}'
From ea1ae5cc4f3e8ab71676ba9b51152fdc812ace52 Mon Sep 17 00:00:00 2001
From: Xianpeng Shen
Date: Tue, 19 Aug 2025 22:08:00 +0300
Subject: [PATCH 130/153] chore: update and rename main.yaml to release.yaml
(#129)
---
.github/workflows/{main.yaml => release.yaml} | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename .github/workflows/{main.yaml => release.yaml} (96%)
diff --git a/.github/workflows/main.yaml b/.github/workflows/release.yaml
similarity index 96%
rename from .github/workflows/main.yaml
rename to .github/workflows/release.yaml
index b4a7f0d..a9edb15 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/release.yaml
@@ -1,9 +1,9 @@
-name: Main
+name: Release
on:
release:
branches: [main]
- types: [published]
+ types: [released]
workflow_dispatch:
inputs:
tag:
From 1a0695bffb51d20f90f059c7c0b54b537ee61be8 Mon Sep 17 00:00:00 2001
From: Xianpeng Shen
Date: Tue, 19 Aug 2025 22:13:38 +0300
Subject: [PATCH 131/153] docs: update README.md to move a badge
---
README.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/README.md b/README.md
index 478a8d4..163cd76 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,5 @@
# Commit-Check GitHub Action
-[](https://github.com/commit-check/commit-check-action/actions/workflows/main.yaml)
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

[](https://github.com/commit-check/commit-check-action/network/dependents)
From 4d869c9231db21d02461d6330ad04d724c0b3ca6 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 25 Aug 2025 12:59:08 +0300
Subject: [PATCH 132/153] chore: update used-by badge by github-actions[bot]
(#125)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 163cd76..06fcc86 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
[](https://github.com/commit-check/commit-check-action/blob/a2873ca0482dd505c93fb51861c953e82fd0a186/action.yml#L59-L69)
From a36334daa1e18458d82ba2c54fc2fa716eae3faf Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 4 Sep 2025 02:59:34 +0300
Subject: [PATCH 133/153] chore(deps): bump pygithub from 2.7.0 to 2.8.1 (#138)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index e5ff28b..50651fe 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,4 +2,4 @@
# For details please see: https://github.com/commit-check/commit-check
commit-check==0.10.1
# Interact with the GitHub API.
-PyGithub==2.7.0
+PyGithub==2.8.1
From 857cc3c18b53099b8b4dd7c144530885fbe69e53 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 4 Sep 2025 04:20:35 +0300
Subject: [PATCH 134/153] chore(deps): bump commit-check from 0.10.1 to 0.10.2
(#137)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 0.10.1 to 0.10.2.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Commits](https://github.com/commit-check/commit-check/compare/v0.10.1...v0.10.2)
---
updated-dependencies:
- dependency-name: commit-check
dependency-version: 0.10.2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 50651fe..133fa28 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.10.1
+commit-check==0.10.2
# Interact with the GitHub API.
PyGithub==2.8.1
From 8079416d15d2ab4a0af0152510b57077a32a0e7d Mon Sep 17 00:00:00 2001
From: Xianpeng Shen
Date: Thu, 4 Sep 2025 04:29:38 +0300
Subject: [PATCH 135/153] fix: Workflow does not contain permissions (#139)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---
.github/workflows/release.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index a9edb15..10087ef 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -1,4 +1,6 @@
name: Release
+permissions:
+ contents: write
on:
release:
From 3cc934cf58039833e50200fa9221ce79221781c4 Mon Sep 17 00:00:00 2001
From: Xianpeng Shen
Date: Thu, 4 Sep 2025 04:30:00 +0300
Subject: [PATCH 136/153] fix: Workflow does not contain permissions (#140)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---
.github/workflows/pre-commit.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
index 7ee1b19..83151fa 100644
--- a/.github/workflows/pre-commit.yml
+++ b/.github/workflows/pre-commit.yml
@@ -1,4 +1,6 @@
name: Run pre-commit
+permissions:
+ contents: read
on:
push:
From 4d2f3846a694e87acb6b544574bdbee1de286177 Mon Sep 17 00:00:00 2001
From: Xianpeng Shen
Date: Thu, 4 Sep 2025 04:30:19 +0300
Subject: [PATCH 137/153] fix: Workflow does not contain permissions (#141)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---
.github/workflows/release-drafter.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
index d25c13e..026bcaf 100644
--- a/.github/workflows/release-drafter.yml
+++ b/.github/workflows/release-drafter.yml
@@ -1,4 +1,6 @@
name: Release Drafter
+permissions:
+ contents: read
on:
push:
From d627c141cd667d09d58245154a10cb995892eb9e Mon Sep 17 00:00:00 2001
From: Xianpeng Shen
Date: Thu, 4 Sep 2025 04:32:43 +0300
Subject: [PATCH 138/153] Revert "fix: Workflow does not contain permissions
(#141)" (#142)
This reverts commit 4d2f3846a694e87acb6b544574bdbee1de286177.
---
.github/workflows/release-drafter.yml | 2 --
1 file changed, 2 deletions(-)
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
index 026bcaf..d25c13e 100644
--- a/.github/workflows/release-drafter.yml
+++ b/.github/workflows/release-drafter.yml
@@ -1,6 +1,4 @@
name: Release Drafter
-permissions:
- contents: read
on:
push:
From 04667fa89b3d3feb0f28facf9c5ff944a5500e85 Mon Sep 17 00:00:00 2001
From: Xianpeng Shen
Date: Thu, 11 Sep 2025 19:49:37 +0300
Subject: [PATCH 139/153] fix: eliminate deprecation warnings during GitHub
authentication (#145)
---
main.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/main.py b/main.py
index ef9c920..8a57c64 100755
--- a/main.py
+++ b/main.py
@@ -3,7 +3,7 @@
import sys
import subprocess
import re
-from github import Github # type: ignore
+from github import Github, Auth # type: ignore
# Constants for message titles
@@ -124,7 +124,10 @@ def add_pr_comments() -> int:
raise ValueError("GITHUB_REF environment variable is not set")
# Initialize GitHub client
- g = Github(token)
+ # Use new Auth API to avoid deprecation warning
+ if not token:
+ raise ValueError("GITHUB_TOKEN is not set")
+ g = Github(auth=Auth.Token(token))
repo = g.get_repo(repo_name)
pull_request = repo.get_issue(int(pr_number))
From f55720f4abe088099ada705679e3b05622821ca5 Mon Sep 17 00:00:00 2001
From: Xianpeng Shen
Date: Fri, 12 Sep 2025 02:08:17 +0300
Subject: [PATCH 140/153] docs: update example and badge in readme (#146)
---
README.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 06fcc86..424d8b5 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
# Commit-Check GitHub Action
-[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)
-
-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)
+
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
-[](https://github.com/commit-check/commit-check-action/blob/a2873ca0482dd505c93fb51861c953e82fd0a186/action.yml#L59-L69)
+[](https://github.com/commit-check/commit-check-action/blob/a2873ca0482dd505c93fb51861c953e82fd0a186/action.yml#L59-L69)
A GitHub Action for checking commit message formatting, branch naming, committer name, email, commit signoff, and more.
@@ -36,7 +36,7 @@ jobs:
contents: read
pull-requests: write
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }} # checkout PR HEAD commit
fetch-depth: 0 # required for merge-base check
From 978b3a8247a6003abfb7aad000c8282c7ba13c65 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 15 Sep 2025 12:49:14 +0300
Subject: [PATCH 141/153] chore: automatically update used-by badge (#150)
* chore: update used-by badge by github-actions[bot]
* docs: add used by RLinf to README
---------
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
Co-authored-by: Xianpeng Shen
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 424d8b5..29e511d 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
[](https://github.com/commit-check/commit-check-action/blob/a2873ca0482dd505c93fb51861c953e82fd0a186/action.yml#L59-L69)
@@ -72,6 +72,8 @@ jobs:
Chainlift
Mila
+
+ RLinf
and many more.
From a7f1b1ec4729748d035323f1cf93d8f45e9b76c5 Mon Sep 17 00:00:00 2001
From: Xianpeng Shen
Date: Wed, 17 Sep 2025 04:10:01 +0300
Subject: [PATCH 142/153] docs: fix capitalization in README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 29e511d..3171c14 100644
--- a/README.md
+++ b/README.md
@@ -82,13 +82,13 @@ jobs:
### `message`
- **Description**: check commit message formatting convention.
- - By default, the rule follows [conventional commits](https://www.conventionalcommits.org/).
+ - By default, the rule follows [Conventional Commits](https://www.conventionalcommits.org/).
- Default: `true`
### `branch`
- **Description**: check git branch naming convention.
- - By default, the rule follows [conventional branch](https://conventional-branch.github.io/).
+ - By default, the rule follows [Conventional Branch](https://conventional-branch.github.io/).
- Default: `true`
### `author-name`
From 09d59e4c7826ba9b97bcddef18248d8dba026eab Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 6 Oct 2025 13:15:26 +0300
Subject: [PATCH 143/153] chore: update used-by badge by github-actions[bot]
(#151)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 3171c14..1feaa9c 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
[](https://github.com/commit-check/commit-check-action/blob/a2873ca0482dd505c93fb51861c953e82fd0a186/action.yml#L59-L69)
From d009e35187a28857656c738120c6be00c6e0d92a Mon Sep 17 00:00:00 2001
From: Xianpeng Shen
Date: Tue, 14 Oct 2025 09:39:12 +0300
Subject: [PATCH 144/153] BREAKING CHNAGE: Upgrade commit-check to v2.0.0
(#152)
* BREAKING CHNAGES: upgrade commit-check to v2.0.0
* BREAKING CHNAGE: remove options
* chore!: remove options
* chore: update code comments
* feat!: change default values and update docs
* docs: update README.md
* docs: update README.md
* fix: update sha to ref
* test: update require_rebase_target
* docs: update README.md
---
.commit-check.yml | 30 ----------------
.github/workflows/commit-check.yml | 9 ++---
.github/workflows/release.yaml | 12 +++----
README.md | 57 ++++++++++++------------------
action.yml | 21 ++---------
commit-check.toml | 23 ++++++++++++
main.py | 12 -------
requirements.txt | 2 +-
8 files changed, 58 insertions(+), 108 deletions(-)
delete mode 100644 .commit-check.yml
create mode 100644 commit-check.toml
diff --git a/.commit-check.yml b/.commit-check.yml
deleted file mode 100644
index f1f725f..0000000
--- a/.commit-check.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-checks:
-
- - check: message
- regex: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)|(Merge).*|(fixup!.*)'
- error: "The commit message should be structured as follows:\n\n
- [optional scope]: \n
- [optional body]\n
- [optional footer(s)]\n\n
- More details please refer to https://www.conventionalcommits.org"
- suggest: please check your commit message whether matches above regex
-
- - check: branch
- regex: ^(bugfix|feature|release|hotfix|task|chore)\/.+|(master)|(main)|(HEAD)|(PR-.+)
- error: "Branches must begin with these types: bugfix/ feature/ release/ hotfix/ task/ chore/"
- suggest: run command `git checkout -b type/branch_name`
-
- - check: author_name
- regex: ^[A-Za-zÀ-ÖØ-öø-ÿ\u0100-\u017F\u0180-\u024F ,.\'-]+$|.*(\[bot])
- error: The committer name seems invalid
- suggest: run command `git config user.name "Your Name"`
-
- - check: author_email
- regex: ^.+@.+$
- error: The committer email seems invalid
- suggest: run command `git config user.email yourname@example.com`
-
- - check: merge_base
- regex: main # it can be master, develop, devel etc based on your project.
- error: Current branch is not rebased onto target branch
- suggest: please ensure your branch is rebased with the target branch
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index b22e048..01ee50a 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -14,18 +14,15 @@ jobs:
steps:
- uses: actions/checkout@v5
with:
- ref: ${{ github.event.pull_request.head.sha }} # checkout PR HEAD commit
- fetch-depth: 0 # fetch all history for all branches and tags
+ ref: ${{ github.event.pull_request.head.ref }} # Checkout PR branch
+ fetch-depth: 0 # Required for merge-base checks
- uses: ./ # self test
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because of use pr-comments
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR comments
with:
message: true
branch: true
author-name: true
author-email: true
- commit-signoff: true
- merge-base: true
- imperative: true
job-summary: true
pr-comments: ${{ github.event_name == 'pull_request' }}
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 10087ef..54b1e22 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -10,7 +10,7 @@ on:
inputs:
tag:
description: 'which tag to update to'
- default: 'v1'
+ default: 'v2'
required: true
ref:
description: 'which branch to update the tag on'
@@ -36,10 +36,10 @@ jobs:
git push --delete origin ${{ inputs.tag }} || true
git tag -a ${{ inputs.tag }} -m 'Retag ${{ inputs.tag }}'
git push origin ${{ inputs.tag }}
- - name: Update tag to v1
+ - name: Update tag to v2
if: github.event.inputs.tag == ''
run: |
- git tag --delete v1 || true
- git push --delete origin v1 || true
- git tag -a v1 -m 'Retag v1'
- git push origin v1
+ git tag --delete v2 || true
+ git push --delete origin v2 || true
+ git tag -a v2 -m 'Retag v2'
+ git push origin v2
diff --git a/README.md b/README.md
index 1feaa9c..f3d1c89 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,18 @@
A GitHub Action for checking commit message formatting, branch naming, committer name, email, commit signoff, and more.
+## What's New in v2
+
+> [!IMPORTANT]
+> This v2 release introduces several 🚨**breaking changes**. Please review the [Breaking Changes](#breaking-changes) section carefully before upgrading.
+
+### Breaking Changes
+
+- Removed support for `commit-signoff`, `merge-base`, and `imperative` inputs — now configured via `commit-check.toml` or `cchk.toml`.
+- Deprecated `.commit-check.yml` in favor of `commit-check.toml` or `cchk.toml`.
+- Changed default values of `author-name` and `author-email` inputs to `false` to align with the default behavior in commit-check.
+- Upgraded core dependency [`commit-check`](https://github.com/commit-check/commit-check) to [**v2.0.0**](https://github.com/commit-check/commit-check/releases/tag/v2.0.0).
+
## Table of Contents
* [Usage](#usage)
@@ -38,19 +50,16 @@ jobs:
steps:
- uses: actions/checkout@v5
with:
- ref: ${{ github.event.pull_request.head.sha }} # checkout PR HEAD commit
- fetch-depth: 0 # required for merge-base check
- - uses: commit-check/commit-check-action@v1
+ ref: ${{ github.event.pull_request.head.ref }} # Checkout PR branch
+ fetch-depth: 0 # Required for merge-base checks
+ - uses: commit-check/commit-check-action@v2
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because use of pr-comments
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR comments
with:
message: true
branch: true
- author-name: true
- author-email: true
- commit-signoff: true
- merge-base: false
- imperative: false
+ author-name: false
+ author-email: false
job-summary: true
pr-comments: ${{ github.event_name == 'pull_request' }}
```
@@ -81,44 +90,22 @@ jobs:
### `message`
-- **Description**: check commit message formatting convention.
- - By default, the rule follows [Conventional Commits](https://www.conventionalcommits.org/).
+- **Description**: check git commit message following [Conventional Commits](https://www.conventionalcommits.org/).
- Default: `true`
### `branch`
-- **Description**: check git branch naming convention.
- - By default, the rule follows [Conventional Branch](https://conventional-branch.github.io/).
+- **Description**: check git branch name following [Conventional Branch](https://conventional-branch.github.io/).
- Default: `true`
### `author-name`
- **Description**: check committer author name.
-- Default: `true`
+- Default: `false`
### `author-email`
- **Description**: check committer author email.
-- Default: `true`
-
-### `commit-signoff`
-
-- **Description**: check committer commit signature.
-- Default: `true`
-
-### `merge-base`
-
-- **Description**: check current branch is rebased onto the target branch.
-- Default: `false`
-
-> [!IMPORTANT]
-> `merge-base` is an experimental feature. By default, it's disabled.
->
-> To use this feature, you need to fetch all history for all branches by setting `fetch-depth: 0` in `actions/checkout`.
-
-### `imperative`
-
-- **Description**: check commit message is imperative mood.
- Default: `false`
### `dry-run`
@@ -141,7 +128,7 @@ jobs:
>
> This feature currently doesn’t work with forked repositories. For more details, refer to issue [#77](https://github.com/commit-check/commit-check-action/issues/77).
-Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check/blob/main/.commit-check.yml). If you want to customize, just add your `.commit-check.yml` config file under your repository root directory.
+Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check-action/blob/main/commit-check.toml). If you want to customize, just add your [`commit-check.toml`](https://commit-check.github.io/commit-check/configuration.html) config file under your repository root directory.
## GitHub Action Job Summary
diff --git a/action.yml b/action.yml
index eb12512..68df492 100644
--- a/action.yml
+++ b/action.yml
@@ -6,32 +6,20 @@ branding:
color: "blue"
inputs:
message:
- description: check commit message formatting convention
+ description: check git commit message following conventional commits
required: false
default: true
branch:
- description: check git branch naming convention
+ description: check git branch name following conventional branch
required: false
default: true
author-name:
description: check committer author name
required: false
- default: true
+ default: false
author-email:
description: check committer author email
required: false
- default: true
- commit-signoff:
- description: check committer commit signature
- required: false
- default: true
- merge-base:
- description: check current branch is rebased onto target branch
- required: false
- default: false
- imperative:
- description: check commit message is in imperative mood
- required: false
default: false
dry-run:
description: run checks without failing
@@ -78,9 +66,6 @@ runs:
BRANCH: ${{ inputs.branch }}
AUTHOR_NAME: ${{ inputs.author-name }}
AUTHOR_EMAIL: ${{ inputs.author-email }}
- COMMIT_SIGNOFF: ${{ inputs.commit-signoff }}
- MERGE_BASE: ${{ inputs.merge-base }}
- IMPERATIVE: ${{ inputs.imperative }}
DRY_RUN: ${{ inputs.dry-run }}
JOB_SUMMARY: ${{ inputs.job-summary }}
PR_COMMENTS: ${{ inputs.pr-comments }}
diff --git a/commit-check.toml b/commit-check.toml
new file mode 100644
index 0000000..5eec90c
--- /dev/null
+++ b/commit-check.toml
@@ -0,0 +1,23 @@
+[commit]
+# https://www.conventionalcommits.org
+conventional_commits = true
+subject_capitalized = false
+subject_imperative = true
+subject_max_length = 80
+subject_min_length = 5
+allow_commit_types = ["feat", "fix", "docs", "style", "refactor", "test", "chore", "ci"]
+allow_merge_commits = true
+allow_revert_commits = true
+allow_empty_commits = false
+allow_fixup_commits = true
+allow_wip_commits = false
+require_body = false
+require_signed_off_by = false
+ignore_authors = ["dependabot[bot]", "copilot[bot]", "pre-commit-ci[bot]"]
+
+[branch]
+# https://conventional-branch.github.io/
+conventional_branch = true
+allow_branch_types = ["feature", "bugfix", "hotfix", "release", "chore", "feat", "fix"]
+require_rebase_target = "origin/main"
+ignore_authors = ["dependabot[bot]", "copilot[bot]", "pre-commit-ci[bot]"]
diff --git a/main.py b/main.py
index 8a57c64..2ec7ea5 100755
--- a/main.py
+++ b/main.py
@@ -15,9 +15,6 @@
BRANCH = os.getenv("BRANCH", "false")
AUTHOR_NAME = os.getenv("AUTHOR_NAME", "false")
AUTHOR_EMAIL = os.getenv("AUTHOR_EMAIL", "false")
-COMMIT_SIGNOFF = os.getenv("COMMIT_SIGNOFF", "false")
-MERGE_BASE = os.getenv("MERGE_BASE", "false")
-IMPERATIVE = os.getenv("IMPERATIVE", "true")
DRY_RUN = os.getenv("DRY_RUN", "false")
JOB_SUMMARY = os.getenv("JOB_SUMMARY", "false")
PR_COMMENTS = os.getenv("PR_COMMENTS", "false")
@@ -33,9 +30,6 @@ def log_env_vars():
print(f"BRANCH = {BRANCH}")
print(f"AUTHOR_NAME = {AUTHOR_NAME}")
print(f"AUTHOR_EMAIL = {AUTHOR_EMAIL}")
- print(f"COMMIT_SIGNOFF = {COMMIT_SIGNOFF}")
- print(f"MERGE_BASE = {MERGE_BASE}")
- print(f"IMPERATIVE = {IMPERATIVE}")
print(f"DRY_RUN = {DRY_RUN}")
print(f"JOB_SUMMARY = {JOB_SUMMARY}")
print(f"PR_COMMENTS = {PR_COMMENTS}\n")
@@ -48,9 +42,6 @@ def run_commit_check() -> int:
"--branch",
"--author-name",
"--author-email",
- "--commit-signoff",
- "--merge-base",
- "--imperative",
]
args = [
arg
@@ -61,9 +52,6 @@ def run_commit_check() -> int:
BRANCH,
AUTHOR_NAME,
AUTHOR_EMAIL,
- COMMIT_SIGNOFF,
- MERGE_BASE,
- IMPERATIVE,
],
)
if value == "true"
diff --git a/requirements.txt b/requirements.txt
index 133fa28..27bbca8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==0.10.2
+commit-check==2.0.0
# Interact with the GitHub API.
PyGithub==2.8.1
From ec301fee109c5180270b1d3e0c17c49c192cc28a Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Tue, 14 Oct 2025 20:24:57 +0300
Subject: [PATCH 145/153] chore: update used-by badge by github-actions[bot]
(#153)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f3d1c89..437e584 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
[](https://github.com/commit-check/commit-check-action/blob/a2873ca0482dd505c93fb51861c953e82fd0a186/action.yml#L59-L69)
From fc0543792ea1ba666c86fea9792d1d72e253ca97 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 20 Oct 2025 23:51:52 +0300
Subject: [PATCH 146/153] chore(deps): bump commit-check from 2.0.0 to 2.1.0
(#155)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Changelog](https://github.com/commit-check/commit-check/blob/main/docs/changelog.rst)
- [Commits](https://github.com/commit-check/commit-check/compare/v2.0.0...v2.1.0)
---
updated-dependencies:
- dependency-name: commit-check
dependency-version: 2.1.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 27bbca8..2156f7d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==2.0.0
+commit-check==2.1.0
# Interact with the GitHub API.
PyGithub==2.8.1
From a4daf2b319722bf056b0809dfae4d97feb4ebe7d Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 5 Nov 2025 03:59:37 +0200
Subject: [PATCH 147/153] chore(deps): bump commit-check from 2.1.0 to 2.1.1
(#158)
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 2156f7d..64a0196 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==2.1.0
+commit-check==2.1.1
# Interact with the GitHub API.
PyGithub==2.8.1
From 5185641addf183421c036d74e279a465b1ba70fb Mon Sep 17 00:00:00 2001
From: Xianpeng Shen
Date: Thu, 6 Nov 2025 00:07:58 +0200
Subject: [PATCH 148/153] feat: remove requiring `ref` in action/checkout
(#162)
---
.github/workflows/commit-check.yml | 1 -
README.md | 1 -
2 files changed, 2 deletions(-)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 01ee50a..7971a30 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -14,7 +14,6 @@ jobs:
steps:
- uses: actions/checkout@v5
with:
- ref: ${{ github.event.pull_request.head.ref }} # Checkout PR branch
fetch-depth: 0 # Required for merge-base checks
- uses: ./ # self test
env:
diff --git a/README.md b/README.md
index 437e584..530b4c9 100644
--- a/README.md
+++ b/README.md
@@ -50,7 +50,6 @@ jobs:
steps:
- uses: actions/checkout@v5
with:
- ref: ${{ github.event.pull_request.head.ref }} # Checkout PR branch
fetch-depth: 0 # Required for merge-base checks
- uses: commit-check/commit-check-action@v2
env:
From a0193b1ca486178b85d7a1db145af34cd227f81f Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 6 Nov 2025 00:09:40 +0200
Subject: [PATCH 149/153] chore(deps): bump commit-check from 2.1.1 to 2.1.2
(#161)
Bumps [commit-check](https://github.com/commit-check/commit-check) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/commit-check/commit-check/releases)
- [Changelog](https://github.com/commit-check/commit-check/blob/main/docs/changelog.rst)
- [Commits](https://github.com/commit-check/commit-check/compare/v2.1.1...v2.1.2)
---
updated-dependencies:
- dependency-name: commit-check
dependency-version: 2.1.2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 64a0196..830b52a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
# Install commit-check CLI
# For details please see: https://github.com/commit-check/commit-check
-commit-check==2.1.1
+commit-check==2.1.2
# Interact with the GitHub API.
PyGithub==2.8.1
From 6e021a9a707719a6f40e3b3de9ee1b855a243943 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Sun, 9 Nov 2025 00:33:53 +0200
Subject: [PATCH 150/153] chore: update used-by badge by github-actions[bot]
(#157)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 530b4c9..8e56f55 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
[](https://github.com/commit-check/commit-check-action/blob/a2873ca0482dd505c93fb51861c953e82fd0a186/action.yml#L59-L69)
From ccb9ad912d0e7047c41fdb23ba39bd9144c339a8 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 25 Nov 2025 01:18:31 +0200
Subject: [PATCH 151/153] chore(deps): bump actions/checkout from 5 to 6 (#166)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: '6'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/commit-check.yml | 2 +-
.github/workflows/release.yaml | 2 +-
.github/workflows/used-by.yml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml
index 7971a30..d9faf0e 100644
--- a/.github/workflows/commit-check.yml
+++ b/.github/workflows/commit-check.yml
@@ -12,7 +12,7 @@ jobs:
contents: read
pull-requests: write
steps:
- - uses: actions/checkout@v5
+ - uses: actions/checkout@v6
with:
fetch-depth: 0 # Required for merge-base checks
- uses: ./ # self test
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 54b1e22..4e0f9b2 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -21,7 +21,7 @@ jobs:
re-tag:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v5
+ - uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ inputs.ref }}
diff --git a/.github/workflows/used-by.yml b/.github/workflows/used-by.yml
index fae6e88..e1aa9de 100644
--- a/.github/workflows/used-by.yml
+++ b/.github/workflows/used-by.yml
@@ -14,7 +14,7 @@ jobs:
used-by:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v5
+ - uses: actions/checkout@v6
- uses: shenxianpeng/used-by@v0.1.4
with:
repo: '${{ github.repository }}'
From ed35ee08c2332753d7734c27f362deb27cc5e26d Mon Sep 17 00:00:00 2001
From: Petr Ruzicka
Date: Fri, 5 Dec 2025 22:31:14 +0100
Subject: [PATCH 152/153] fix: use env in steps instead of inputs in bash code
(#167)
---
.github/workflows/release.yaml | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 4e0f9b2..2e6068d 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -31,11 +31,13 @@ jobs:
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Update tag with parameter
if: github.event.inputs.tag != ''
+ env:
+ TAG: ${{ inputs.tag }}
run: |
- git tag --delete ${{ inputs.tag }} || true
- git push --delete origin ${{ inputs.tag }} || true
- git tag -a ${{ inputs.tag }} -m 'Retag ${{ inputs.tag }}'
- git push origin ${{ inputs.tag }}
+ git tag --delete "$TAG" || true
+ git push --delete origin "$TAG" || true
+ git tag -a "$TAG" -m "Retag $TAG"
+ git push origin "$TAG"
- name: Update tag to v2
if: github.event.inputs.tag == ''
run: |
From 8cc66f7ddeedef7c6cc401f56b276352e3922102 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 8 Dec 2025 14:52:33 +0200
Subject: [PATCH 153/153] chore: update used-by badge by github-actions[bot]
(#168)
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 8e56f55..3924cab 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)

-[](https://github.com/commit-check/commit-check-action/network/dependents)
+[](https://github.com/commit-check/commit-check-action/network/dependents)
[](https://github.com/marketplace/actions/commit-check-action)
[](https://github.com/commit-check/commit-check-action/blob/a2873ca0482dd505c93fb51861c953e82fd0a186/action.yml#L59-L69)