From 7c0144b43593367cae386c1e583d4e55b1caca1c Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Tue, 12 May 2026 12:24:18 -0700 Subject: [PATCH] use gh run instead of gh api since api is being deprecated --- .github/workflows/notify_nightly.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/notify_nightly.yml b/.github/workflows/notify_nightly.yml index 8322219cf..67704428e 100644 --- a/.github/workflows/notify_nightly.yml +++ b/.github/workflows/notify_nightly.yml @@ -23,12 +23,10 @@ jobs: shell: bash id: duration run: |- - MILLIS=$(gh api \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2026-03-10" \ - "/repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/timing" | jq '.run_duration_ms') - echo "ms = $MILLIS" - DURATION=$(date -d@"$(("$MILLIS" / 1000))" -u +%H:%M:%S) + START=$(gh run view "$GITHUB_RUN_ID" --json startedAt --jq ".startedAt") + START_SECONDS=$(date -d"$START" +%s) + NOW_SECONDS=$(date +%s) + DURATION=$(date -d@"$((NOW_SECONDS - START_SECONDS))" -u +%H:%M:%S) echo "result = $DURATION" echo "result=$DURATION" >> "$GITHUB_OUTPUT" - name: Send to mattermost