Skip to content

update

4db842b
Select commit
Loading
Failed to load commit list.
Open

ci: log number of merged PRs into main #83

update
4db842b
Select commit
Loading
Failed to load commit list.
Cursor / Cursor BugBot completed Jul 8, 2025 in 1m 52s

BugBot Review

BugBot completed review and found 1 potential issue

Request ID: serverGenReqId_a3f6481e-833c-4bd0-a34f-80b832e5518c

Details

Bug: Bash Arithmetic Error with Null Values

The workflow fails with a bash arithmetic error when attempting to increment the success count for an existing date entry. This occurs because the jq expression, which retrieves the current success count from the spreadsheet, returns the string "null" if the corresponding cell in column C is empty or contains non-numeric data. Bash's arithmetic expansion cannot process the string "null", leading to a syntax error. The script should default the count to 0 if it's "null" before performing the increment.

.github/workflows/log-merge-group-success.yml#L42-L47

current_date_index=$(echo "$spreadsheet_data" | jq --arg current_date "$current_date" '(.values | map(.[0])) | (index($current_date) | if . == null then null else . + 1 end)')
current_number_of_successes=$(echo "$spreadsheet_data" | jq --arg current_date "$current_date" '(.values[] | select(.[0] == $current_date) | .[2] | tonumber) // null')
if [ "$current_date_index" == "null" ]; then
curl --silent --header "Authorization: Bearer $token" --header "Content-Type: application/json" --request POST --data "{\"values\":[[\"$current_date\", \"\", 1]]}" https://sheets.googleapis.com/v4/spreadsheets/"$SPREADSHEET_ID"/values/"$SHEET_NAME"!A:C:append?valueInputOption=USER_ENTERED
else
curl --silent --header "Authorization: Bearer $token" --header "Content-Type: application/json" --request PUT --data "{\"values\":[[\"$current_date\", \"\", $(("$current_number_of_successes" + 1))]]}" https://sheets.googleapis.com/v4/spreadsheets/"$SPREADSHEET_ID"/values/"$SHEET_NAME"!A"$current_date_index":C"$current_date_index"?valueInputOption=USER_ENTERED

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎