PP-11314 add publishing workflow for release commits #3
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: Prevent Merge Based on Unmerged Release PR | |
on: | |
pull_request: | |
permissions: | |
pull-requests: read | |
jobs: | |
prevent_merge: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check for Unmerged PR | |
id: check_pr | |
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const prs = await github.rest.pulls.list({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
state: 'open' | |
}) | |
const openRelease = prs.data.find(pr => pr.user.login === '$release-user' && pr.state === 'open') | |
if (openRelease) { | |
console.log('There is an unmerged release PR. Preventing further PR merges.') | |
core.setFailed('There is an unmerged release PR, please merge it before merging this PR.') | |
} | |
env: | |
release-user-id: alphagov-pay-ci-concourse | |
ACTIONS_STEP_DEBUG: true | |
# https://api.github.com/users/alphagov-pay-ci-concourse | |