fix: fix command injection (#421)

* fix command injection

* fix command injection

* fix command injection

* fix command injection

* fix command injection

* delete check repo

* fix command injection

* fix command injection

* add comments

* add comments

* add comments

* add comments

* delete chinese comments

* limit title length
This commit is contained in:
Linlang
2024-10-12 16:22:50 +08:00
committed by GitHub
parent f808c35c34
commit 8341430bc9
2 changed files with 48 additions and 14 deletions
+27 -14
View File
@@ -1,18 +1,5 @@
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
lint-title:
runs-on: ubuntu-latest
steps:
- name: Check PR Title for Conventional Commit Format
run: |
if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|Release-As)(\(\w+\))?!?:\s.*'; then
echo 'The title does not conform to the Conventional Commit.'
echo 'Please refer to "https://www.conventionalcommits.org/"'
exit 1
fi
name: Lint pull request title
on:
pull_request:
types:
@@ -20,3 +7,29 @@ on:
- synchronize
- reopened
- edited
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
lint-title:
runs-on: ubuntu-latest
steps:
# This step is necessary because the lint title uses the .commitlintrc.js file in the project root directory.
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install commitlint
run: npm install --save-dev @commitlint/{config-conventional,cli}
- name: Validate PR Title with commitlint
env:
BODY: ${{ github.event.pull_request.title }}
run: |
echo "$BODY" | npx commitlint --config .commitlintrc.js