From 40d30cc7b0e9c7d4f5fa59d9ec0369a0a25cf1d0 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Thu, 6 Feb 2025 11:16:29 +0100 Subject: [PATCH] block until run finished --- .github/workflows/ci-trigger.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-trigger.yml b/.github/workflows/ci-trigger.yml index ad0c98f96..4259d3e2d 100644 --- a/.github/workflows/ci-trigger.yml +++ b/.github/workflows/ci-trigger.yml @@ -13,18 +13,17 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - set -x - - sleep 5 - RUNID=$(gh -R ${{ github.repository }} run list | grep '${{ github.ref_name }} CI-builds ${{ github.sha }}' | grep -Po '(?<=workflow_run)\s+\d+') - while [[ -z ${RUNID} ]]; do - sleep 5 - RUNID=$(gh -R ${{ github.repository }} run list | grep '${{ github.ref_name }} CI-builds ${{ github.sha }}' | grep -Po '(?<=workflow_run)\s+\d+') - done + #sleep 5 + #RUNID=$(gh -R ${{ github.repository }} run list | grep '${{ github.ref_name }} CI-builds ${{ github.sha }}' | grep -Po '(?<=workflow_run)\s+\d+') + #while [[ -z ${RUNID} ]]; do + # sleep 5 + # RUNID=$(gh -R ${{ github.repository }} run list | grep '${{ github.ref_name }} CI-builds ${{ github.sha }}' | grep -Po '(?<=workflow_run)\s+\d+') + #done echo "Trigger workflow_run[in_progress]: '${{ github.ref_name }} ${{ github.workflow }} ${{ github.sha }}'" sleep 5 - gh -R ${{ github.repository }} run watch -i 30 ${RUNID} >/dev/null || true + # this will block until the run is finished + gh -R ${{ github.repository }} run watch -i 30 ${{ github.run_id }} >/dev/null || true sleep 5 - name: Trigger workflow_run[completed]