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