Skip to content

Commit dbe32d8

Browse files
committed
Update find_new_boards.sh
1 parent 414b7b8 commit dbe32d8

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

.github/scripts/find_new_boards.sh

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,9 @@
44
owner_repository=$1
55
base_ref=$2
66

7-
#download the boards.txt file from the base branch
7+
# Download the boards.txt file from the base branch
88
curl -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
2411
diff=$(diff -u boards_base.txt boards.txt)
2512

@@ -31,18 +18,13 @@ then
3118
exit 0
3219
fi
3320

34-
# Print the diff
35-
echo "Diff:"
36-
echo "$diff"
37-
3821
# Extract added or modified lines (lines starting with '+' or '-')
3922
modified_lines=$(echo "$diff" | grep -E '^[+-][^+-]')
4023

41-
# Print the modified lines
24+
# Print the modified lines for debugging
4225
echo "Modified lines:"
4326
echo "$modified_lines"
4427

45-
4628
boards_array=()
4729
previous_board=""
4830

@@ -63,14 +45,6 @@ do
6345
fi
6446
done <<< "$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
7549
board_count=${#boards_array[@]}
7650

0 commit comments

Comments
 (0)