Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/release-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release Checks
on:
workflow_call:
inputs:
next-release-label-check:
type: boolean
default: false
pull_request:

permissions:
contents: read

jobs:
next-release-label-check:
name: Check for "next release" label
runs-on: ubuntu-latest
if: inputs.next-release-label-check
steps:
-
name: Check for "next release" label
uses: actions/github-script@v6
with:
script: |
const { data: pulls } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
});

// check for open PRs which contain the 'next release' label
const openPRs = pulls.filter(pr =>
pr.labels.some(label => label.name === 'next release')
).map(pr => ` - #${pr.number}: ${pr.title}`);

if (openPRs.length > 0) {
const errorMessage = 'Found "next release" label on the following open pull requests:\n'
+ openPRs.join('\n')
+ '\nPlease merge them before release.';
core.setFailed(errorMessage);
} else {
console.log('No "next release" label found on any open pull requests!');
}
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ jobs:
static-analysis:
uses: ./.github/workflows/static-analysis.yml

release_checks:
uses: ./.github/workflows/release-checks.yml
with:
next-release-label-check: true

build_docs:
uses: ./.github/workflows/doctum.yml
with:
Expand Down