From 530187bb12a4da2b3120e5cdfa6d59272636eea0 Mon Sep 17 00:00:00 2001 From: Ethan Dye Date: Wed, 20 Nov 2024 21:33:38 -0700 Subject: [PATCH] Fix logic in nightly build Signed-off-by: Ethan Dye --- .github/workflows/nightly.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c3c1ab8..10ae44f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -23,19 +23,18 @@ jobs: COMMIT="$(git rev-list --after="24 hours" ${{ github.sha }} -- '**/*.swift' | head -n 1)" if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then echo "should_run=true" >> $GITHUB_ENV - exit 0 elif [[ -z $COMMIT ]]; then echo "should_run=false" >> $GITHUB_ENV - exit 0 - fi - STATUS="$(gh api -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "/repos/ecdye/macSubtitleOCR/actions/runs?branch=main&head_sha=${COMMIT}&status=completed" | \ - jq '.workflow_runs[] | select(.name == "Test") | .conclusion')" - if [[ $STATUS == "\"success\"" ]]; then - echo "should_run=true" >> $GITHUB_ENV else - echo "should_run=false" >> $GITHUB_ENV + STATUS="$(gh api -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "/repos/ecdye/macSubtitleOCR/actions/runs?branch=main&head_sha=${COMMIT}&status=completed" | \ + jq '.workflow_runs[] | select(.name == "Test") | .conclusion')" + if [[ $STATUS == "\"success\"" ]]; then + echo "should_run=true" >> $GITHUB_ENV + else + echo "should_run=false" >> $GITHUB_ENV + fi fi nightly: