-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.34 KB
/
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
name: test
on:
push:
branches: [test]
jobs:
get-changed-files:
strategy:
matrix:
patch:
- 26key
- 35key
- 45key
- 45key-numbers
- 46key
runs-on: ubuntu-latest
steps:
- name: Fetch source code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
- name: check-match
id: check-match
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
ALL_CHANGED_FILES_COUNT: ${{ steps.changed-files.outputs.all_changed_files_count }}
MATRIX: ${{ matrix.patch }}
run: |
MATCH_FOUND=false
for file in ${ALL_CHANGED_FILES}; do
echo "Matrix value '$MATRIX' matches changed file '$file'."
if [[ "$file" == "patches/$VALUE.patch" || "$file" != patches/* ]]; then
echo "matches changed file '$file'."
MATCH_FOUND=true
break
fi
done
echo "match=$MATCH_FOUND" >> $GITHUB_OUTPUT
- name: test
if: ${{steps.check-match.outputs.match == 'true'}}
env:
test: ${{ steps.check-match.outputs.match }}
run: echo $test