You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by da...@apache.org on 2023/06/30 14:18:00 UTC

[beam] branch master updated: changed rerun logic to accomodate when job is not in check list (#27318)

This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 2d9635c26c3 changed rerun logic to accomodate when job is not in check list (#27318)
2d9635c26c3 is described below

commit 2d9635c26c35d7b3ebe166dfeb250b01f2d5f038
Author: Vlado Djerek <20...@users.noreply.github.com>
AuthorDate: Fri Jun 30 16:17:54 2023 +0200

    changed rerun logic to accomodate when job is not in check list (#27318)
---
 .github/actions/rerun-job-action/action.yml | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/.github/actions/rerun-job-action/action.yml b/.github/actions/rerun-job-action/action.yml
index 73a50ed8ae2..2b16a81a025 100644
--- a/.github/actions/rerun-job-action/action.yml
+++ b/.github/actions/rerun-job-action/action.yml
@@ -57,17 +57,24 @@ runs:
     shell: bash
     run: | 
       URL="${{github.api_url}}/repos/${{inputs.github_repository}}/commits/${{env.prsha}}/check-runs"
-      read -r STATUS CONCLUSION CHECK_SUITE_ID<<< $(curl  \
+      CHECK_RUN=$(curl  \
       -H 'Authorization: Bearer ${{inputs.github_token}}' \
       -H "Accept: application/vnd.github+json" \
       -H "X-GitHub-Api-Version: 2022-11-28" \
-      -s $URL | jq -r '.check_runs | .[] | select(.name=="${{inputs.github_job}}") | "\(.status) \(.conclusion) \(.check_suite.id)"')
+      -s $URL | jq -r '.check_runs | .[] | select(.name=="${{inputs.github_job}}")')
+      if [ -z "$CHECK_RUN" ]; then
+        echo "No check runs found for this job"
+        echo skip=true >> $GITHUB_ENV
+        exit 0
+      fi
+      read -r STATUS CONCLUSION CHECK_SUITE_ID<<< $(echo $CHECK_RUN | jq -r '"\(.status) \(.conclusion) \(.check_suite.id)"')
       echo status=$STATUS >> $GITHUB_ENV
       echo conclusion=$CONCLUSION >> $GITHUB_ENV
       echo check_suite_id=$CHECK_SUITE_ID >> $GITHUB_ENV
  
-  - name: Enable Rerun
-    if: ${{env.status == 'completed' && (env.conclusion == 'success' || env.conclusion == 'skipped')}}
+
+  - name: Disable Rerun for Success or Skipped
+    if: ${{(env.status == 'completed' && (env.conclusion == 'success' || env.conclusion == 'skipped')) || env.skip == 'true'}}
     shell: bash
     run: echo rerun=false >> $GITHUB_ENV