-
-
Notifications
You must be signed in to change notification settings - Fork 8
39 lines (37 loc) · 1.28 KB
/
check-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Check PRs
on:
pull_request:
types:
- labeled
- unlabeled
- opened
- reopened
- ready_for_review
- synchronize
jobs:
get_versions:
name: Get versions
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.versions.outputs.versions }}
steps:
- name: Get versions from labels
id: versions
env:
LABELS: ${{ toJson(github.event.pull_request.labels.*.description) }}
run: echo "versions=$(echo $LABELS | jq -c '[.[] | select(. != null and (startswith("snapshot/") or startswith("pre/") or startswith("release/")))]')" >> "$GITHUB_OUTPUT"
check:
needs: get_versions
if: ${{ needs.get_versions.outputs.versions != '[]' }}
strategy:
matrix:
version: ${{ fromJson(needs.get_versions.outputs.versions) }}
uses: './.github/workflows/check.yml'
with:
version: ${{ matrix.version }}
push_changed: false
publish: false
# Publishing of PRs will only work correctly if we're only building a single one
# NOTE: There is no way to get the length of an array in Github Actions Expressions
# So the heuristic is: If it contains a comma, it's a list with more than one element.
publish_prs: ${{ !contains(needs.get_versions.outputs.versions, ',') }}