-
Notifications
You must be signed in to change notification settings - Fork 2.4k
47 lines (37 loc) · 1.54 KB
/
version-check.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
40
41
42
43
44
45
46
47
name: Check work package version
on:
pull_request:
types: [labeled, synchronize]
permissions:
contents: read # to fetch code (actions/checkout)
pull-requests: write # to comment on the PR
jobs:
check-pr:
if: contains(github.event.pull_request.labels.*.name, 'needs review')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Verify linked version matches core version
id: version-check
run: ./script/ci/version_check.sh "${{ github.event.pull_request.body }}"
- name: Add comment if versions differ
if: steps.version-check.outputs.version_mismatch == 'true'
uses: marocchino/sticky-pull-request-comment@v2
with:
header: version-mismatch-comment
message: |
The provided work package version does not match the core version:
- Work package URL: ${{ steps.version-check.outputs.wp_url }}
- Work package version: ${{steps.version-check.outputs.wp_version}}
- Core version: ${{steps.version-check.outputs.core_version}}
Please make sure that:
- The work package version OR your pull request target branch is correct
- name: Version check passed
if: steps.version-check.outputs.version_mismatch != 'true'
uses: marocchino/sticky-pull-request-comment@v2
with:
header: version-mismatch-comment
delete: true