Skip to content

Commit 8695e07

Browse files
committed
ci: remove duplicated lint jobs/steps
1 parent 2bd890b commit 8695e07

File tree

3 files changed

+35
-60
lines changed

3 files changed

+35
-60
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
- name: Install
3030
run: pnpm install --frozen-lockfile --prefer-offline
3131
- name: Install Docs
32-
run: cd docs && pnpm install --frozen-lockfile --prefer-offline
33-
- name: lint
34-
run: cd docs && pnpm lint
35-
- name: Build
36-
run: cd docs && pnpm build
32+
working-directory: docs
33+
run: pnpm install --frozen-lockfile --prefer-offline
34+
- name: Build Docs
35+
working-directory: docs/
36+
run: pnpm build

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

-54
This file was deleted.

.github/workflows/lint.yml

+30-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: Lint
33
on:
44
push:
55
branches: [main]
6-
pull_request:
6+
# Triggering on pull_request_target to provide quick feedback before
7+
# all the other workflow runs triggered on pull_request are approved
8+
pull_request_target:
79
branches:
810
- "**"
911
paths:
@@ -19,8 +21,17 @@ jobs:
1921
lint:
2022
name: Lint
2123
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
2226
steps:
2327
- uses: actions/checkout@v4
28+
with:
29+
persist-credentials: false
30+
- uses: actions/checkout@v4
31+
if: github.event_name == 'pull_request_target'
32+
with:
33+
ref: "refs/pull/${{ github.event.number }}/merge"
34+
persist-credentials: false
2435
- uses: pnpm/action-setup@v4
2536
with:
2637
version: 9
@@ -45,3 +56,21 @@ jobs:
4556
- name: Lint website
4657
working-directory: docs/
4758
run: pnpm lint
59+
comment:
60+
needs: [lint]
61+
if: failure() && github.event_name == 'pull_request_target' && needs.lint.result == 'failure'
62+
name: Comment
63+
runs-on: ubuntu-latest
64+
permissions:
65+
pull-requests: write
66+
steps:
67+
- uses: actions/github-script@v7
68+
name: Comment on failure
69+
with:
70+
script: |
71+
github.rest.issues.createComment({
72+
issue_number: context.issue.number,
73+
owner: context.repo.owner,
74+
repo: context.repo.repo,
75+
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."
76+
})

0 commit comments

Comments
 (0)