File tree Expand file tree Collapse file tree 1 file changed +2
-28
lines changed Expand file tree Collapse file tree 1 file changed +2
-28
lines changed Original file line number Diff line number Diff line change 4
4
owner_repository=$1
5
5
base_ref=$2
6
6
7
- # download the boards.txt file from the base branch
7
+ # Download the boards.txt file from the base branch
8
8
curl -L -o boards_base.txt https://raw.githubusercontent.com/$owner_repository /$base_ref /boards.txt
9
9
10
- # url="https://api.github.com/repos/$owner_repository/pulls/$pr_number/files"
11
- # echo $url
12
-
13
- # Get changes in boards.txt file from PR
14
- # Boards_modified_url=$(curl -s $url | jq -r '.[] | select(.filename == "boards.txt") | .raw_url')
15
-
16
- # Echo the modified boards.txt file URL
17
- # echo "Modified boards.txt file URL:"
18
- # echo $Boards_modified_url
19
-
20
- # Download the modified boards.txt file
21
- # curl -L -o boards_pr.txt $Boards_modified_url
22
-
23
10
# Compare boards.txt file in the repo with the modified file from PR
24
11
diff=$( diff -u boards_base.txt boards.txt)
25
12
31
18
exit 0
32
19
fi
33
20
34
- # Print the diff
35
- echo " Diff:"
36
- echo " $diff "
37
-
38
21
# Extract added or modified lines (lines starting with '+' or '-')
39
22
modified_lines=$( echo " $diff " | grep -E ' ^[+-][^+-]' )
40
23
41
- # Print the modified lines
24
+ # Print the modified lines for debugging
42
25
echo " Modified lines:"
43
26
echo " $modified_lines "
44
27
45
-
46
28
boards_array=()
47
29
previous_board=" "
48
30
63
45
fi
64
46
done <<< " $modified_lines"
65
47
66
- # Print all boards found
67
- echo " Boards found:"
68
- for board in ${boards_array[@]}
69
- do
70
- echo $board
71
- done
72
-
73
-
74
48
# Create JSON like string with all boards found and pass it to env variable
75
49
board_count=${# boards_array[@]}
76
50
You can’t perform that action at this time.
0 commit comments