Skip to content

Check that the PR links to documentation #134

Check that the PR links to documentation

Check that the PR links to documentation #134

# 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
# 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.mjs