23 lines
757 B
YAML
23 lines
757 B
YAML
name: Changeset Check
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, labeled, unlabeled]
|
|
|
|
jobs:
|
|
changeset:
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no changeset') }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Require a change file
|
|
env:
|
|
BASE_REF: ${{ github.base_ref }}
|
|
run: |
|
|
if ! git diff --name-only --diff-filter=A "origin/$BASE_REF...HEAD" -- '.changeset/*.md' | grep -q .; then
|
|
echo "::error::Add a change file with \`knope document-change\`, or label the PR 'no changeset' if it isn't user-facing."
|
|
exit 1
|
|
fi
|