Skip to content

Commit

Permalink
Fix logic in nightly build
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <mrtops03@gmail.com>
  • Loading branch information
ecdye committed Nov 21, 2024
1 parent 6b9b071 commit 530187b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 530187b

Please sign in to comment.