Check release branch #1493
Workflow file for this run
This file contains 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
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')) | |
} |