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 44owner_repository=$1
55base_ref=$2
66
7- # download the boards.txt file from the base branch
7+ # Download the boards.txt file from the base branch
88curl -L -o boards_base.txt https://raw.githubusercontent.com/$owner_repository /$base_ref /boards.txt
99
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-
2310# Compare boards.txt file in the repo with the modified file from PR
2411diff=$( diff -u boards_base.txt boards.txt)
2512
3118 exit 0
3219fi
3320
34- # Print the diff
35- echo " Diff:"
36- echo " $diff "
37-
3821# Extract added or modified lines (lines starting with '+' or '-')
3922modified_lines=$( echo " $diff " | grep -E ' ^[+-][^+-]' )
4023
41- # Print the modified lines
24+ # Print the modified lines for debugging
4225echo " Modified lines:"
4326echo " $modified_lines "
4427
45-
4628boards_array=()
4729previous_board=" "
4830
6345 fi
6446done <<< " $modified_lines"
6547
66- # Print all boards found
67- echo " Boards found:"
68- for board in ${boards_array[@]}
69- do
70- echo $board
71- done
72-
73-
7448# Create JSON like string with all boards found and pass it to env variable
7549board_count=${# boards_array[@]}
7650
You can’t perform that action at this time.
0 commit comments