File tree Expand file tree Collapse file tree 2 files changed +17
-16
lines changed Expand file tree Collapse file tree 2 files changed +17
-16
lines changed Original file line number Diff line number Diff line change 22
33# Get inputs from command
44owner_repository=$1
5- pr_number =$2
5+ base_ref =$2
66
7- url= " https://api.github.com/repos/ $owner_repository /pulls/ $pr_number /files "
8- echo $url
7+ # Download the boards.txt file from the base branch
8+ curl -L -o boards_base.txt https://raw.githubusercontent.com/ $owner_repository / $base_ref /boards.txt
99
10- # Get changes in boards.txt file from PR
11- Boards_modified_url =$( curl -s $url | jq -r ' .[] | select(.filename == " boards.txt") | .raw_url ' )
10+ # Compare boards.txt file in the repo with the modified file from PR
11+ diff =$( diff -u boards_base.txt boards.txt)
1212
13- # Echo the modified boards.txt file URL
14- echo " Modified boards.txt file URL:"
15- echo $Boards_modified_url
16-
17- # Download the modified boards.txt file
18- curl -L -o boards_pr.txt $Boards_modified_url
19-
20- # Compare boards.txt file in the repo with the modified file
21- diff=$( diff -u boards.txt boards_pr.txt)
13+ # Check if the diff is empty
14+ if [ -z " $diff " ]
15+ then
16+ echo " No changes in boards.txt file"
17+ echo " FQBNS="
18+ exit 0
19+ fi
2220
2321# Extract added or modified lines (lines starting with '+' or '-')
2422modified_lines=$( echo " $diff " | grep -E ' ^[+-][^+-]' )
2523
24+ # Print the modified lines for debugging
25+ echo " Modified lines:"
26+ echo " $modified_lines "
27+
2628boards_array=()
2729previous_board=" "
28- file=" boards.txt"
2930
3031# Extract board names from the modified lines, and add them to the boards_array
3132while read -r line
Original file line number Diff line number Diff line change 2929
3030 - name : Get board name
3131 run :
32- bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.event.number }}
32+ bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.base_ref }}
3333
3434 test-boards :
3535 needs : find-boards
You can’t perform that action at this time.
0 commit comments