From 2547c0f6685b42f22377df9c7ead9fd4b7f91df6 Mon Sep 17 00:00:00 2001 From: "lightning-it-shared-assets-sync[bot]" <307342877+lightning-it-shared-assets-sync[bot]@users.noreply.github.com> Date: Sat, 22 Aug 2026 08:12:50 +0000 Subject: [PATCH] chore: sync repository quality assets Shared-Assets-Source-SHA: bab69a31d01b0fb0f3becb1cdf3bd6879e0b38e8 Shared-Assets-Source-Run: 32561673417 Shared-Assets-Source-Attempt: 1 Shared-Assets-Sync-App-ID: 4351516 --- .github/workflows/copilot-review.yml | 34 ++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/copilot-review.yml b/.github/workflows/copilot-review.yml index 9a631f2..ae7994d 100644 --- a/.github/workflows/copilot-review.yml +++ b/.github/workflows/copilot-review.yml @@ -241,7 +241,7 @@ jobs: EVENT_BASE_REF: ${{ github.event.pull_request.base.ref }} EVENT_BODY: ${{ github.event.pull_request.body }} EVENT_TITLE: ${{ github.event.pull_request.title }} - EVENT_UPDATED_AT: ${{ github.event.pull_request.updated_at }} + EVENT_EDITED_AT: ${{ github.event.pull_request.updated_at }} GH_TOKEN: ${{ github.token }} HEAD_SHA: ${{ github.event.pull_request.head.sha }} HEAD_REF: ${{ github.event.pull_request.head.ref }} @@ -280,6 +280,34 @@ jobs: [[ "${BASE_SHA}" =~ ^[0-9a-f]{40}$ ]] [[ "${HEAD_SHA}" =~ ^[0-9a-f]{40}$ ]] [[ "${PR_NUMBER}" =~ ^[1-9][0-9]*$ ]] + # For an edited webhook, REST updated_at is the event's edit + # revision. Bind it to GraphQL lastEditedAt because unrelated + # comments and reviews may advance only the live REST updated_at. + [[ "${EVENT_EDITED_AT}" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$ ]] + owner="${REPOSITORY%%/*}" + repository="${REPOSITORY#*/}" + read -r -d '' query <<'GRAPHQL' || true + query($owner: String!, $repository: String!, $number: Int!) { + repository(owner: $owner, name: $repository) { + pullRequest(number: $number) { + number + lastEditedAt + } + } + } + GRAPHQL + metadata="$(api_read graphql \ + -f query="${query}" \ + -F owner="${owner}" \ + -F repository="${repository}" \ + -F number="${PR_NUMBER}")" + jq -e \ + --arg edited_at "${EVENT_EDITED_AT}" \ + --argjson number "${PR_NUMBER}" ' + ((.errors // []) | length) == 0 + and .data.repository.pullRequest.number == $number + and .data.repository.pullRequest.lastEditedAt == $edited_at + ' <<<"${metadata}" >/dev/null pr="$(api_read "repos/${REPOSITORY}/pulls/${PR_NUMBER}")" jq -e \ --arg base_ref "${EVENT_BASE_REF}" \ @@ -288,11 +316,9 @@ jobs: --arg head_ref "${HEAD_REF}" \ --arg head_sha "${HEAD_SHA}" \ --arg repository "${REPOSITORY}" \ - --arg title "${EVENT_TITLE}" \ - --arg updated_at "${EVENT_UPDATED_AT}" ' + --arg title "${EVENT_TITLE}" ' .state == "open" and .draft == false - and .updated_at == $updated_at and .title == $title and (.body // "") == $body and .base.ref == $base_ref