-
Notifications
You must be signed in to change notification settings - Fork 5
29 lines (27 loc) · 1.28 KB
/
validate-pr-release-info.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
name: Validate Release Info
on:
pull_request:
types: [labeled, unlabeled, opened, edited, reopened, synchronize, ready_for_review]
paths:
- 'src/hooks/**/use*.ts'
- 'src/index.ts'
env:
IS_LABELED_RELEASE: ${{ contains(github.event.pull_request.labels.*.name, 'patch release') || contains(github.event.pull_request.labels.*.name, 'minor release') || contains(github.event.pull_request.labels.*.name, 'major release') }}
IS_LABELED_NON_LOGICAL: ${{ contains(github.event.pull_request.labels.*.name, 'tooling') || contains(github.event.pull_request.labels.*.name, 'documentation') || contains(github.event.pull_request.labels.*.name, 'restructure') }}
jobs:
check-pr:
name: Validate Release Label and Notes
runs-on: ubuntu-latest
steps:
- name: 'Check if needed'
id: if
run: echo "NEEDS_CHECK=${{ fromJSON(env.IS_LABELED_RELEASE) || !fromJSON(env.IS_LABELED_NON_LOGICAL) }}" >> "$GITHUB_OUTPUT"
- name: 'Checkout'
if: ${{ fromJSON(steps.if.outputs.NEEDS_CHECK) }}
uses: actions/checkout@v4
- name: 'Validate Pull Request Metadata'
if: ${{ fromJSON(steps.if.outputs.NEEDS_CHECK) }}
uses: jefflinse/[email protected]
with:
mode: validate
repo-token: ${{ secrets.GITHUB_TOKEN }}