Check that the PR has a changeset #6374
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fails if a PR doesn't have a changeset and is not labeled | |
# as "no changeset needed" | |
name: Check that the PR has a changeset | |
on: | |
merge_group: | |
pull_request: | |
branches: | |
- main | |
- v2 | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- labeled | |
- unlabeled | |
jobs: | |
check-if-changeset: | |
name: Check that PR has a changeset | |
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 merge group is valid | |
if: github.event_name == 'merge_group' | |
run: node scripts/validate-merge-group.mjs | |
- name: Check if PR has a changeset | |
if: github.event_name == 'pull_request' | |
env: | |
GITHUB_EVENT_PULL_REQUEST_LABELS: ${{ toJson(github.event.pull_request.labels) }} | |
run: node scripts/validate-pull-request-changeset.mjs |