github: fix Discord notification to handle multiple commits in queue push

Previously, commit queue pushes only notified about the final commit
instead of all commits being pushed to main. We now properly detect and
notify about all commits in a queue push in chronological order.

Changes include:

1. Enhanced push step in queue-main.yml and queue-dev.yml:
   - Capture range of commits being pushed using git log origin/main..COMMIT_TO_PUSH
   - Use --reverse flag to get commits in chronological order (oldest first)
   - Store commit list in GITHUB_OUTPUT for notification step

2. Updated Discord notification steps:
   - Iterate through all commits in the push (not just the final one)
   - Checkout each commit individually before calling discord_notify.py
   - Send separate notification for each commit in correct chronological order

3. Proper edge case handling:
   - Single commit pushes: Works correctly (sends one notification)
   - Empty pushes: Skips notification when no commits to notify about
   - Formatted commits: Includes both original and formatting commits

The fix ensures that when developers push multiple commits to a queue branch
(e.g., queue-main-username), Discord notifications are sent for each commit
that gets pushed to main, not just the latest one. Notifications appear in
chronological order matching the actual commit sequence.

Co-Authored-By: sketch <hello@sketch.dev>

Change-ID: s6a336eb2f945539fk
diff --git a/.github/workflows/queue-dev.yml b/.github/workflows/queue-dev.yml
index 9a56ed4..87a4353 100644
--- a/.github/workflows/queue-dev.yml
+++ b/.github/workflows/queue-dev.yml
@@ -57,18 +57,29 @@
           COMMIT_SHA=$(git rev-parse "${COMMIT_TO_PUSH}")
           echo "commit_sha=${COMMIT_SHA}" >> $GITHUB_OUTPUT
 
+          # Get the list of commits that would be pushed (in chronological order)
+          COMMITS_TO_NOTIFY=$(git log origin/main.."${COMMIT_TO_PUSH}" --reverse --format="%H" | tr '\n' ' ')
+          echo "commits_to_notify=${COMMITS_TO_NOTIFY}" >> $GITHUB_OUTPUT
+          echo "Commits that would be pushed and notified: ${COMMITS_TO_NOTIFY}"
+
           echo "Would push to main: ${COMMIT_TO_PUSH}"
         env:
           GITHUB_TOKEN: ${{ github.token }}
 
-      - name: Checkout pushed commit for Discord notification
-        if: success()
-        run: |
-          git checkout ${{ steps.push.outputs.commit_sha }}
-
-      - name: Send Discord notification
+      - name: Send Discord notifications for all commits that would be pushed
         if: success()
         env:
           DISCORD_WEBHOOK_FOR_COMMITS: ${{ secrets.DISCORD_WEBHOOK_FOR_COMMITS }}
-          GITHUB_SHA: ${{ steps.push.outputs.commit_sha }}
-        run: python3 .github/scripts/discord_notify.py
+        run: |
+          COMMITS="${{ steps.push.outputs.commits_to_notify }}"
+          if [[ -z "$COMMITS" ]]; then
+            echo "No commits to notify about"
+            exit 0
+          fi
+          
+          echo "Sending Discord notifications for commits that would be pushed: $COMMITS"
+          for commit_sha in $COMMITS; do
+            echo "Sending notification for commit: $commit_sha"
+            git checkout "$commit_sha"
+            GITHUB_SHA="$commit_sha" python3 .github/scripts/discord_notify.py
+          done