Refactor on workflows
parent
b9329d5154
commit
cbab55332b
|
@ -3,11 +3,9 @@ name: NodeJS CI
|
|||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -33,13 +31,23 @@ jobs:
|
|||
- name: Lint Check
|
||||
if: ${{ success() }}
|
||||
run: |
|
||||
npm run format:check
|
||||
npm run lint
|
||||
|
||||
- name: Code Format
|
||||
- name: Code Format Check
|
||||
id: codeFormatCheck
|
||||
if: ${{ success() }}
|
||||
run: |
|
||||
npm run format:check
|
||||
|
||||
- name: Code Format
|
||||
if: always() && steps.codeFormatCheck.outcome == 'failure'
|
||||
run: |
|
||||
npm run format
|
||||
git config user.name "GitHub Actions Bot"
|
||||
git config user.email "<>"
|
||||
git commit -a -m "Code Format"
|
||||
git push
|
||||
|
||||
- name: Security Check
|
||||
if: ${{ success() }}
|
||||
run: |
|
||||
|
|
|
@ -44,6 +44,14 @@ jobs:
|
|||
run: |
|
||||
npm run test:unit
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
npm run lint
|
||||
|
||||
- name: Security
|
||||
run: |
|
||||
npm run security:check
|
||||
|
||||
- name: Add Code Format Fail Comment
|
||||
if: always() && steps.codeFormat.outcome == 'failure'
|
||||
uses: thollander/actions-comment-pull-request@v1
|
||||
|
|
Loading…
Reference in New Issue