diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1e7278..3abc915 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,6 +20,7 @@ jobs: runs-on: self-hosted outputs: data: ${{ steps.set_vars.outputs.json }} + has_data: ${{ steps.set_vars.outputs.has_data }} steps: - name: Checkout Code uses: actions/checkout@v3 @@ -91,6 +92,14 @@ jobs: done json_array="$json_array]" + # Output the JSON array + echo "json=$json_array" >> $GITHUB_OUTPUT + # Determine if json_array is empty + if [ "$json_array" = "[]" ]; then + echo "has_data=false" >> $GITHUB_OUTPUT + else + echo "has_data=true" >> $GITHUB_OUTPUT + fi # Output the JSON array echo "json=$json_array" >> $GITHUB_OUTPUT @@ -99,6 +108,7 @@ jobs: name: Run Quality Control runs-on: self-hosted needs: process_raw + if: needs.process_raw.outputs.has_data == 'true' strategy: matrix: config: ${{ fromJson(needs.process_raw.outputs.data) }} @@ -154,7 +164,8 @@ jobs: commit_results: name: Commit and Push QC Results runs-on: self-hosted - needs: run_qc + needs: [process_raw, run_qc] + if: needs.process_raw.outputs.has_data == 'true' steps: - name: Checkout Code