-
Notifications
You must be signed in to change notification settings - Fork 36
28 lines (28 loc) · 964 Bytes
/
release-test.yml
File metadata and controls
28 lines (28 loc) · 964 Bytes
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
name: Check release branch
on:
workflow_dispatch:
pull_request:
types: [opened,closed,synchronize,edited,review_requested,reopened]
branches:
- master
pull_request_review:
types: [submitted]
jobs:
check-open-prs:
if: startsWith(github.event.pull_request.head.ref, 'release-')
runs-on: ubuntu-24.04
steps:
- name: Check unmerged PRs
uses: actions/github-script@v7
with:
script: |
const prs = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
base: context.payload.pull_request.head.ref,
state: 'open'
})
const prs_filtered = prs.data.filter((p)=>!p.draft)
if ( prs_filtered.length > 0 ) {
core.setFailed('There are umerged open PRs targetting this branch:\n'+prs_filtered.map((p)=>p.title + ' ( ' + p.html_url + ' )').join('\n'))
}