Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pr-commit-lint): 完成 pr-commit-lint 分支的任务 #12

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5b4a213
Create lint.yml
lvmingze123 Oct 11, 2024
6a50c24
Update lint.yml
lvmingze123 Oct 11, 2024
3f6a98d
Update lint.yml
lvmingze123 Oct 11, 2024
6ad8820
Update lint.yml
lvmingze123 Oct 11, 2024
a814804
Update lint.yml
lvmingze123 Oct 11, 2024
1d6f92b
Update lint.yml
lvmingze123 Oct 11, 2024
54d0ae3
Update lint.yml
lvmingze123 Oct 11, 2024
9d4a786
Update commitlint workflow to exclude main branch and dynamically con…
hepear Oct 11, 2024
45789e9
Update commitlint workflow to exclude main branch and dynamically con…
hepear Oct 11, 2024
ddbed8a
Update commitlint.yml to ensure it triggers on push/pull_request and …
hepear Oct 13, 2024
fe3fcf2
Update commitlint.yml to ensure it triggers on push/pull_request and …
hepear Oct 13, 2024
9eea77c
Update commitlint.yml to use latest versions of actions and fix Node.…
hepear Oct 13, 2024
e1a6f98
Update commitlint.yml to ensure package-lock.json exists and dependen…
hepear Oct 13, 2024
37747ca
Update commitlint.yml to ensure package.json and package-lock.json exist
hepear Oct 13, 2024
0c72b73
Update commitlint.yml to address deprecation warnings
hepear Oct 13, 2024
87383c4
Add .gitignore file to exclude node_modules/
hepear Oct 13, 2024
ec612f7
Update commitlint.yml
hepear Oct 13, 2024
4de7454
Update commitlint.yml
hepear Oct 13, 2024
02522f2
Update commitlint.yml
hepear Oct 13, 2024
2c17416
Update commitlint.yml
hepear Oct 13, 2024
eef2d9a
Update commitlint.yml
hepear Oct 13, 2024
7e536e9
Update commitlint.yml
hepear Oct 13, 2024
b4f77b2
Update commitlint.yml
hepear Oct 13, 2024
4b24a2b
Update commitlint.yml
hepear Oct 13, 2024
8bba714
Update commitlint.yml
hepear Oct 13, 2024
50b1db9
Add new commitlint workflow
hepear Oct 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update commitlint.yml
hepear committed Oct 13, 2024
commit eef2d9ae462cd33f2d8ad42791a21e1b559e17c6
9 changes: 9 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -25,12 +25,18 @@ jobs:
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
- name: Check commits
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
# 获取当前仓库的所有提交信息
git log --pretty=format:'%H %s%n' --no-merges | tee /tmp/commits.log
# 打印所有提交信息以供调试
cat /tmp/commits.log
# 获取环境变量中的 GitHub 事件上下文
echo "GitHub Event Context:"
echo "$GITHUB_CONTEXT"
# 确定检查的范围
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
# 获取 PR 的 base 和 head SHA
@@ -45,6 +51,9 @@ jobs:
COMMIT_RANGE="$PARENT_SHA...HEAD"
fi
# 打印提交范围
echo "Commit Range: $COMMIT_RANGE"
# 确保提交范围有效
if [ -z "$COMMIT_RANGE" ]; then
echo "No valid commit range found."