mirror of
https://github.com/element-plus/element-plus.git
synced 2025-12-19 09:09:40 +08:00
66 lines
1.7 KiB
YAML
66 lines
1.7 KiB
YAML
name: Lint Commit Message
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, edited, reopened]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
# if pull request title is D2M, then skip this job
|
|
if: ${{ !contains(github.event.pull_request.title, 'D2M') }}
|
|
continue-on-error: true
|
|
outputs:
|
|
failed: ${{ steps.lint_commit.outputs.failed == 'true' }}
|
|
env:
|
|
PULL_REQUEST_NUMBER: ${{ github.event.number }}
|
|
PULL_REQUEST_AUTHOR: ${{ github.event.pull_request.user.login }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm i --frozen-lockfile
|
|
|
|
- name: Lint commit
|
|
id: lint_commit
|
|
run: echo "${{ github.event.pull_request.title }}" | pnpm run lint:commit || echo "failed=true" >> $GITHUB_OUTPUT
|
|
|
|
- name: Set success result
|
|
if: ${{ steps.lint_commit.outputs.failed != 'true' }}
|
|
run: echo 'true' > ./lint-result.txt
|
|
|
|
- name: Set failed result
|
|
if: ${{ steps.lint_commit.outputs.failed == 'true' }}
|
|
run: echo 'false' > ./lint-result.txt
|
|
|
|
- name: Set PR number
|
|
run: echo "$PULL_REQUEST_NUMBER" > ./pr.txt
|
|
|
|
- name: Set PR author
|
|
run: echo "$PULL_REQUEST_AUTHOR" > ./author.txt
|
|
|
|
- uses: actions/upload-artifact@v5
|
|
with:
|
|
name: commit-lint-result
|
|
path: ./lint-result.txt
|
|
|
|
- uses: actions/upload-artifact@v5
|
|
with:
|
|
name: pr-number
|
|
path: ./pr.txt
|
|
|
|
- uses: actions/upload-artifact@v5
|
|
with:
|
|
name: pr-author
|
|
path: ./author.txt
|