-
Notifications
You must be signed in to change notification settings - Fork 1.7k
39 lines (33 loc) · 1.12 KB
/
check-links-to-docs.yml
File metadata and controls
39 lines (33 loc) · 1.12 KB
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
# Fails if a PR doesn't link to documentation (pr/issue on hardhat-website) and is not labeled
# as "no docs needed"
name: Check that the PR links to documentation
on:
merge_group:
pull_request:
branches:
- main
- v2
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
- edited
jobs:
check-links-to-docs:
name: Check that PR links to documentation
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v5
- name: Set up the environment
uses: ./.github/actions/setup-env
# We need to fetch the base ref because the pull request check inspects the diff between the head and the base ref
- run: git fetch origin "$GITHUB_BASE_REF":"$GITHUB_BASE_REF"
- name: Check if PR links to documentation
if: github.event_name == 'pull_request'
env:
GITHUB_EVENT_PULL_REQUEST_LABELS: ${{ toJson(github.event.pull_request.labels) }}
GITHUB_EVENT_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
run: node scripts/validate-pull-request-docs.ts