From cd9280cd083463bcfff203557d5bfec8afdc9764 Mon Sep 17 00:00:00 2001 From: 0penBrain <48731257+0penBrain@users.noreply.github.com> Date: Wed, 15 Feb 2023 18:46:20 +0100 Subject: [PATCH] CI: improve Prepare reporting by using 'continue-on-error' for silent failing --- .github/workflows/sub_prepare.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/sub_prepare.yml b/.github/workflows/sub_prepare.yml index c6772d3ca9..54db3c7fdb 100644 --- a/.github/workflows/sub_prepare.yml +++ b/.github/workflows/sub_prepare.yml @@ -31,8 +31,8 @@ on: artifactBasename: type: string required: true - failOnOldRebase: - default: false + dontFailOnOldRebase: + default: true type: boolean required: false maxRebaseHours: @@ -88,6 +88,7 @@ jobs: echo "Base SHA is $baseSha, Head SHA is $headSha" | tee -a ${{env.reportdir}}${{ env.reportfilename }} - name: Check if PR has been recently rebased if: env.isPR == 'true' + continue-on-error: ${{ inputs.dontFailOnOldRebase }} run: | baseDate=$(curl -H "Accept: application/vnd.github+json" -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/commits/$baseSha | jq -r '.commit.committer.date') dateDiff=$(( ( $(date +%s) - $(date -d $baseDate +%s) ) / 3600 )) @@ -96,13 +97,7 @@ jobs: if [ $dateDiff -gt ${{ inputs.maxRebaseHours }} ] then echo -n ":warning: Pull request should be rebased" | tee -a ${{env.reportdir}}${{ env.reportfilename }} - if ${{ inputs.failOnOldRebase }} - then - echo "" | tee -a ${{env.reportdir}}${{ env.reportfilename }} - exit 1 - else - echo " ... but it is ignored by setting" | tee -a ${{env.reportdir}}${{ env.reportfilename }} - fi + exit 1 fi - name: Determine base and head SHA in case of push if: env.isPush == 'true'