From 922125cd53cdc26ea1f31a1430a30f804bbf64a8 Mon Sep 17 00:00:00 2001 From: Kevin Bost Date: Thu, 3 Sep 2026 22:55:51 -0700 Subject: [PATCH] Fix nightly release workflow previous run detection Ensure the `check_for_changes` step reliably identifies the last *completed* workflow run. The previous logic could pick an incorrect run due to inconsistent indexing. By explicitly filtering for `--status completed`, the latest completed run is correctly identified. --- .github/workflows/nightly_release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly_release.yml b/.github/workflows/nightly_release.yml index 1485c520eb..8f7e98e803 100644 --- a/.github/workflows/nightly_release.yml +++ b/.github/workflows/nightly_release.yml @@ -25,9 +25,8 @@ jobs: - id: check_for_changes name: Check for changes run: | - # Grab the last two run, since the latest run will be the current one executing - $workflowList = gh run list --workflow "${{ github.workflow }}" --branch "${{ github.ref_name }}" --json databaseId --limit 2 --repo "${{ github.repository }}" - $runId = ($workflowList | ConvertFrom-Json)[1].databaseId + $workflowList = gh run list --workflow "${{ github.workflow }}" --branch "${{ github.ref_name }}" --json databaseId --status completed --repo "${{ github.repository }}" + $runId = ($workflowList | ConvertFrom-Json)[0].databaseId $lastRunHash = ((gh run view $runId --json headSha --repo "${{ github.repository }}") | ConvertFrom-Json).headSha echo "Last hash $lastRunHash"