Skip to content

Check release branch #1480

Check release branch

Check release branch #1480

Workflow file for this run

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-latest
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'))
}