From 60eb849fad32b2e3d23d9f80bcbecc34df91c7f9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 17 Aug 2023 11:56:03 +0200 Subject: ci: Check for open milestone before release --- .github/workflows/release.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index adabed2fb..0c5b6d4b1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,6 +87,21 @@ jobs: - name: Bump version id: bump run: "tox -e update-version -- ${{ github.event.inputs.release_type }}" + - name: Check milestone + uses: actions/github-script@v6 + with: + script: | + const milestones = await github.paginate(github.rest.issues.listMilestones, { + owner: context.repo.owner, + repo: context.repo.repo, + }); + const names = milestones.map(milestone => milestone.title); + console.log(`milestones: ${names}`); + + const milestone = milestones.find(milestone => milestone.title === "v${{ steps.bump.outputs.version }}"); + if (milestone !== undefined) { + core.setFailed(`Found open milestone ${milestone.title} with ${milestone.open_issues} open and ${milestone.closed_issues} closed issues!`); + } - name: Push release commit/tag run: | git push origin ${{ steps.find-branch.outputs.result }} -- cgit v1.2.3-54-g00ecf