From de9797c98f883e95094e673e5d6c441c93d6d041 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 26 Nov 2024 14:11:11 +0000 Subject: [PATCH] Extract release sanity checks to reusable workflow Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .github/workflows/release-checks.yml | 37 ++++++++++++++++++++++++++++ .github/workflows/release-make.yml | 22 ++++------------- 2 files changed, 42 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/release-checks.yml diff --git a/.github/workflows/release-checks.yml b/.github/workflows/release-checks.yml new file mode 100644 index 00000000000..1f20acea22c --- /dev/null +++ b/.github/workflows/release-checks.yml @@ -0,0 +1,37 @@ +name: Release Sanity checks +on: + workflow_call: + secrets: + GITHUB_TOKEN: + required: true + inputs: + repository: + type: string + required: true + description: "The repository (in form owner/repo) to check for release blockers" + +permissions: {} +jobs: + checks: + name: Sanity checks + runs-on: ubuntu-24.04 + steps: + - name: Check for X-Release-Blocker label on any open issues or PRs + uses: actions/github-script@v7 + env: + REPO: ${{ inputs.repository }} + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { REPO } = process.env; + const { data } = await github.rest.search.issuesAndPullRequests({ + q: `repo:${REPO} label:X-Release-Blocker is:open`, + per_page: 50, + }); + + if (data.total_count) { + data.items.forEach(item => { + core.error(`Release blocker: ${item.html_url}`); + }); + core.setFailed(`Found release blockers!`); + } diff --git a/.github/workflows/release-make.yml b/.github/workflows/release-make.yml index f585a8de383..03d24bfab46 100644 --- a/.github/workflows/release-make.yml +++ b/.github/workflows/release-make.yml @@ -42,26 +42,14 @@ permissions: {} jobs: checks: name: Sanity checks - runs-on: ubuntu-24.04 permissions: issues: read pull-requests: read - steps: - - name: Check for X-Release-Blocker label on any open issues or PRs - uses: actions/github-script@v7 - with: - script: | - const { data } = await github.rest.search.issuesAndPullRequests({ - q: `repo:${context.repo.owner}/${context.repo.repo} label:X-Release-Blocker is:open`, - per_page: 50, - }); - - if (data.total_count) { - data.items.forEach(item => { - core.error(`Release blocker: ${item.html_url}`); - }); - core.setFailed(`Found release blockers!`); - } + uses: matrix-org/matrix-js-sdk/.github/workflows/release-checks.yml@develop + secrets: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + repository: ${{ github.repository }} release: name: Release