ci: simplify workflows (#9737)

This commit is contained in:
三咲智子
2022-09-14 09:50:55 +08:00
committed by GitHub
parent f7d43542fd
commit 69f823f00d
4 changed files with 46 additions and 34 deletions

View File

@@ -1,4 +1,4 @@
name: Lint commit message
name: Lint Commit Message
on:
pull_request:
@@ -8,12 +8,6 @@ jobs:
lint:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
node-version: ['16']
include:
- node-version: '16'
node-name: 'Latest'
outputs:
failed: ${{ steps.lint_commit.outputs.failed == 'true' }}
env:
@@ -21,17 +15,14 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Add dev branch
run: git branch dev origin/dev
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: 16
- name: Cache ~/.pnpm-store
uses: actions/cache@v3
@@ -47,25 +38,32 @@ jobs:
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Lint commit
id: lint_commit
run: pnpm lint:commit || echo "::set-output name=failed::true"
- 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
- uses: actions/upload-artifact@v3
with:
name: commit-lint-report
path: ./commit-lint.txt
- uses: actions/upload-artifact@v3
with:
name: commit-lint-result
path: ./lint-result.txt
- uses: actions/upload-artifact@v3
with:
name: pr-number