mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 01:53:55 +00:00
ci: enable autofix for pr linting (#20085)
This commit is contained in:
parent
b811742f89
commit
feaebff823
28
.github/workflows/autofix-docs.yml
vendored
Normal file
28
.github/workflows/autofix-docs.yml
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
name: autofix.ci # needed to securely identify the workflow
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "docs/**"
|
||||||
|
- ".github/workflows/docs.yml"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: corepack enable
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: "pnpm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install
|
||||||
|
|
||||||
|
- name: Lint (docs)
|
||||||
|
run: pnpm lint:docs:fix
|
33
.github/workflows/autofix.yml
vendored
Normal file
33
.github/workflows/autofix.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: autofix.ci # needed to securely identify the workflow
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- "docs/**"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
code:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: corepack enable
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: "pnpm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install
|
||||||
|
|
||||||
|
- name: Build (stub)
|
||||||
|
run: pnpm build:stub
|
||||||
|
|
||||||
|
- name: Lint (code)
|
||||||
|
run: pnpm lint:fix
|
||||||
|
|
||||||
|
- name: Test (unit)
|
||||||
|
run: pnpm test:unit -u
|
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@ -88,6 +88,8 @@ jobs:
|
|||||||
run: pnpm test:types
|
run: pnpm test:types
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
|
# autofix workflow will be triggered instead for PRs
|
||||||
|
if: github.event_name == 'push'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
|
||||||
@ -169,9 +171,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Test (unit)
|
- name: Test (unit)
|
||||||
run: pnpm test:unit
|
run: pnpm test:unit
|
||||||
env:
|
|
||||||
TEST_ENV: ${{ matrix.env }}
|
|
||||||
TEST_BUILDER: ${{ matrix.builder }}
|
|
||||||
|
|
||||||
- name: Test (fixtures)
|
- name: Test (fixtures)
|
||||||
run: pnpm test:fixtures
|
run: pnpm test:fixtures
|
||||||
|
11
.github/workflows/docs.yml
vendored
11
.github/workflows/docs.yml
vendored
@ -5,14 +5,13 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
- ".github/workflows/docs.yml"
|
- ".github/workflows/docs.yml"
|
||||||
|
# autofix workflow will be triggered instead for PRs
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
|
||||||
paths:
|
# Remove default permissions of GITHUB_TOKEN for security
|
||||||
- "docs/**"
|
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
|
||||||
- ".github/workflows/docs.yml"
|
permissions: {}
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-docs:
|
lint-docs:
|
||||||
|
2
.github/workflows/introspect.yml
vendored
2
.github/workflows/introspect.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Docs
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
"example": "./scripts/example.sh dev",
|
"example": "./scripts/example.sh dev",
|
||||||
"example:build": "./scripts/example.sh build",
|
"example:build": "./scripts/example.sh build",
|
||||||
"lint": "eslint --ext .vue,.ts,.js,.mjs .",
|
"lint": "eslint --ext .vue,.ts,.js,.mjs .",
|
||||||
|
"lint:fix": "eslint --ext .vue,.ts,.js,.mjs . --fix",
|
||||||
"lint:docs": "markdownlint ./docs && case-police 'docs/**/*.md'",
|
"lint:docs": "markdownlint ./docs && case-police 'docs/**/*.md'",
|
||||||
"lint:docs:fix": "markdownlint ./docs --fix && case-police 'docs/**/*.md' --fix",
|
"lint:docs:fix": "markdownlint ./docs --fix && case-police 'docs/**/*.md' --fix",
|
||||||
"nuxi": "JITI_ESM_RESOLVE=1 nuxi",
|
"nuxi": "JITI_ESM_RESOLVE=1 nuxi",
|
||||||
|
Loading…
Reference in New Issue
Block a user