Skip to content

Commit 38bb49e

Browse files
committed
ci: remove duplicated lint jobs/steps
1 parent 66ffa19 commit 38bb49e

File tree

3 files changed

+35
-61
lines changed

3 files changed

+35
-61
lines changed

.github/workflows/check-docs-site.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14-
lint:
15-
name: Lint
14+
build:
15+
name: Build Docs
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
@@ -26,8 +26,8 @@ jobs:
2626
- name: Install
2727
run: pnpm install --frozen-lockfile --prefer-offline
2828
- name: Install Docs
29-
run: cd docs && pnpm install --frozen-lockfile --prefer-offline
30-
- name: lint
31-
run: cd docs && pnpm lint
32-
- name: Build
33-
run: cd docs && pnpm build
29+
working-directory: docs/
30+
run: pnpm install --frozen-lockfile --prefer-offline
31+
- name: Build Docs
32+
working-directory: docs/
33+
run: pnpm build

.github/workflows/comment-on-linter-error.yml

-54
This file was deleted.

.github/workflows/lint.yml

+28
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,18 @@ jobs:
1616
lint:
1717
name: Lint
1818
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
1921
steps:
2022
- uses: actions/checkout@v4
23+
if: github.event_name != 'pull_request_target'
24+
with:
25+
persist-credentials: false
26+
- uses: actions/checkout@v4
27+
if: github.event_name == 'pull_request_target'
28+
with:
29+
ref: "refs/pull/${{ github.event.number }}/merge"
30+
persist-credentials: false
2131
- uses: pnpm/action-setup@v4
2232
with:
2333
version: 9
@@ -42,3 +52,21 @@ jobs:
4252
- name: Lint website
4353
working-directory: docs/
4454
run: pnpm lint
55+
comment:
56+
needs: [lint]
57+
if: failure() && github.event_name == 'pull_request_target' && needs.lint.result == 'failure'
58+
name: Comment
59+
runs-on: ubuntu-latest
60+
permissions:
61+
pull-requests: write
62+
steps:
63+
- uses: actions/github-script@v7
64+
name: Comment on failure
65+
with:
66+
script: |
67+
github.rest.issues.createComment({
68+
issue_number: context.issue.number,
69+
owner: context.repo.owner,
70+
repo: context.repo.repo,
71+
body: "Thanks for submitting this PR!\n\nUnfortunately, it has some linter errors, so we can't merge it yet. Can you please fix them?\n\nRunning pnpm lint:fix in the root of the repository may fix them automatically."
72+
})

0 commit comments

Comments
 (0)