-
-
Notifications
You must be signed in to change notification settings - Fork 440
50 lines (42 loc) · 1.45 KB
/
alteration-compatibility-test.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
48
49
50
# This integration test ci job is used to test the DB alterations compatibility with the current codebase.
name: Alteration Compatibility Test
on:
push:
branches:
- master
- "push-action/**"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check-alteration-changes:
runs-on: ubuntu-latest
steps:
- name: checkout head
uses: actions/checkout@v4
with:
fetch-depth: 0
# compare the current codebase with HEAD and check if there are any changes under the alterations folder
- name: Check for alteration changes
id: alteration-changes
run: |
CHANGE_FILES=$(git diff --name-only HEAD..origin/${{ github.base_ref }} | grep 'packages/schemas/alterations/*')
if [ -z "$CHANGE_FILES" ]; then
echo "No alteration changes detected"
echo "::set-output name=has-alteration-changes::false"
else
echo "Alteration changes detected"
echo "$CHANGE_FILES"
echo "::set-output name=has-alteration-changes::true"
fi
package:
needs: check-alteration-changes
runs-on: ubuntu-latest
if: ${{needs.check-alteration-changes.outputs.has-alteration-changes == 'true'}}
steps:
- name: checkout base
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.base_ref }}