forked from NomicFoundation/hardhat
-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (40 loc) · 1.28 KB
/
comment-on-linter-error.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Comment on lint failure
on:
pull_request_target:
branches:
- $default-branch
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
jobs:
comment_on_lint_failure:
name: Comment on lint failure
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- uses: actions/setup-node@v2
with:
node-version: 12
cache: yarn
- name: Install
run: yarn --frozen-lockfile
- name: Build
run: yarn build
- name: lint
run: yarn lint
- name: Check dependency versions
run: node scripts/check-dependencies.js
- uses: actions/github-script@v6
name: Comment on failure
if: ${{ failure() }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Thanks for submitting this PR!\nUnfortunately, it has some linter errors, so we can't merge it yet. Can you please fix them?\nRunning yarn `lint:fix` in the root of the repository may fix them automatically."
})