Skip to content

Commit bc52469

Browse files
authored
Extract release sanity checks to reusable workflow (#4546)
Signed-off-by: Michael Telatynski <[email protected]>
1 parent edac6a9 commit bc52469

File tree

2 files changed

+42
-17
lines changed

2 files changed

+42
-17
lines changed

.github/workflows/release-checks.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release Sanity checks
2+
on:
3+
workflow_call:
4+
secrets:
5+
GITHUB_TOKEN:
6+
required: true
7+
inputs:
8+
repository:
9+
type: string
10+
required: true
11+
description: "The repository (in form owner/repo) to check for release blockers"
12+
13+
permissions: {}
14+
jobs:
15+
checks:
16+
name: Sanity checks
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- name: Check for X-Release-Blocker label on any open issues or PRs
20+
uses: actions/github-script@v7
21+
env:
22+
REPO: ${{ inputs.repository }}
23+
with:
24+
github-token: ${{ secrets.GITHUB_TOKEN }}
25+
script: |
26+
const { REPO } = process.env;
27+
const { data } = await github.rest.search.issuesAndPullRequests({
28+
q: `repo:${REPO} label:X-Release-Blocker is:open`,
29+
per_page: 50,
30+
});
31+
32+
if (data.total_count) {
33+
data.items.forEach(item => {
34+
core.error(`Release blocker: ${item.html_url}`);
35+
});
36+
core.setFailed(`Found release blockers!`);
37+
}

.github/workflows/release-make.yml

+5-17
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,14 @@ permissions: {}
4242
jobs:
4343
checks:
4444
name: Sanity checks
45-
runs-on: ubuntu-24.04
4645
permissions:
4746
issues: read
4847
pull-requests: read
49-
steps:
50-
- name: Check for X-Release-Blocker label on any open issues or PRs
51-
uses: actions/github-script@v7
52-
with:
53-
script: |
54-
const { data } = await github.rest.search.issuesAndPullRequests({
55-
q: `repo:${context.repo.owner}/${context.repo.repo} label:X-Release-Blocker is:open`,
56-
per_page: 50,
57-
});
58-
59-
if (data.total_count) {
60-
data.items.forEach(item => {
61-
core.error(`Release blocker: ${item.html_url}`);
62-
});
63-
core.setFailed(`Found release blockers!`);
64-
}
48+
uses: matrix-org/matrix-js-sdk/.github/workflows/release-checks.yml@develop
49+
secrets:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
with:
52+
repository: ${{ github.repository }}
6553

6654
release:
6755
name: Release

0 commit comments

Comments
 (0)