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

potiuk pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 3c643c259ef4adda9ec8004f4817da6ab455fd76
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu Oct 8 13:09:34 2020 +0200

    Better message when Building Image fails or gets cancelled. (#11333)
    
    (cherry picked from commit 9dc32a3d8a3164dced57b5ed5a488acfe6799b31)
---
 .github/workflows/build-images-workflow-run.yml | 35 ++++++++++++++++++-------
 .github/workflows/codeql-cancel.yml             |  2 +-
 2 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/build-images-workflow-run.yml 
b/.github/workflows/build-images-workflow-run.yml
index 5984a51..a30947d 100644
--- a/.github/workflows/build-images-workflow-run.yml
+++ b/.github/workflows/build-images-workflow-run.yml
@@ -59,7 +59,7 @@ jobs:
     if: github.repository == 'apache/airflow' || 
github.event.workflow_run.event != 'schedule'
     steps:
       - name: "Cancel duplicated 'CI Build' runs"
-        uses: potiuk/cancel-workflow-runs@v3
+        uses: 
potiuk/cancel-workflow-runs@ca4b70a6910d33990e16d95e0c116914cdc0dfd0 #v3_1
         id: cancel
         with:
           token: ${{ secrets.GITHUB_TOKEN }}
@@ -78,7 +78,7 @@ jobs:
         # in GitHub Actions, we have to use Job names to match 
Event/Repo/Branch from the
         # build-info step there to find the duplicates ¯\_(ツ)_/¯.
 
-        uses: potiuk/cancel-workflow-runs@v3
+        uses: 
potiuk/cancel-workflow-runs@ca4b70a6910d33990e16d95e0c116914cdc0dfd0 #v3_1
         with:
           cancelMode: namedJobs
           token: ${{ secrets.GITHUB_TOKEN }}
@@ -96,7 +96,7 @@ jobs:
         # can cancel all the matching "Build Images" workflow runs in the two 
following steps.
         # Yeah. Adding to the complexity ¯\_(ツ)_/¯.
 
-        uses: potiuk/cancel-workflow-runs@v3
+        uses: 
potiuk/cancel-workflow-runs@ca4b70a6910d33990e16d95e0c116914cdc0dfd0 #v3_1
         id: cancel-failed
         with:
           token: ${{ secrets.GITHUB_TOKEN }}
@@ -133,7 +133,7 @@ jobs:
         # followed by one of the run ids. Yes I know it's super complex 
¯\_(ツ)_/¯.
 
         if: env.BUILD_IMAGES == 'true' && 
steps.cancel-failed.outputs.cancelledRuns != '[]'
-        uses: potiuk/cancel-workflow-runs@v3
+        uses: 
potiuk/cancel-workflow-runs@ca4b70a6910d33990e16d95e0c116914cdc0dfd0 #v3_1
         with:
           cancelMode: namedJobs
           token: ${{ secrets.GITHUB_TOKEN }}
@@ -270,7 +270,7 @@ jobs:
               echo "::set-output name=proceed::false"
           fi
       - name: Initiate Github Checks for Building image
-        uses: LouisBrunner/[email protected]
+        uses: 
LouisBrunner/checks-action@9f02872da71b6f558c6a6f190f925dde5e4d8798 #v1.1.0
         id: build-image-check
         with:
           token: ${{ secrets.GITHUB_TOKEN }}
@@ -318,7 +318,7 @@ jobs:
         run: ./scripts/ci/images/ci_push_production_images.sh
         if: matrix.image-type == 'PROD' && steps.defaults.outputs.proceed == 
'true'
       - name: Update Github Checks for Building image with status
-        uses: LouisBrunner/[email protected]
+        uses: 
LouisBrunner/checks-action@9f02872da71b6f558c6a6f190f925dde5e4d8798 #v1.1.0
         if: always() && steps.defaults.outputs.proceed == 'true'
         with:
           token: ${{ secrets.GITHUB_TOKEN }}
@@ -333,16 +333,33 @@ jobs:
             [Image Build](https://github.com/${{ github.repository 
}}/actions/runs/${{ github.run_id }})
             for details" }
 
+  cancel-on-build-cancel:
+    name: "Cancel 'CI Build' jobs on build image cancelling."
+    runs-on: ubuntu-latest
+    if: cancelled()
+    needs: [build-images]
+    steps:
+      - name: "Canceling the 'CI Build' source workflow in case of failure!"
+        uses: potiuk/cancel-workflow-runs@cancel_message #v3
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+          cancelMode: self
+          notifyPRCancel: true
+          notifyPRCancelMessage: "Building image for the PR has been cancelled"
+          sourceRunId: ${{ github.event.workflow_run.id }}
+
   cancel-on-build-failure:
-    name: "Cancel 'CI Build' jobs on build image failure"
+    name: "Cancel 'CI Build' jobs on build image failing."
     runs-on: ubuntu-latest
-    if: cancelled() || failure()
+    if: failure()
     needs: [build-images]
     steps:
       - name: "Canceling the 'CI Build' source workflow in case of failure!"
-        uses: potiuk/cancel-workflow-runs@v3
+        uses: 
potiuk/cancel-workflow-runs@ca4b70a6910d33990e16d95e0c116914cdc0dfd0 #v3_1
         with:
           token: ${{ secrets.GITHUB_TOKEN }}
           cancelMode: self
           notifyPRCancel: true
+          notifyPRCancelMessage: |
+            Building images for the PR has failed. Follow the the workflow 
link to check the reason.
           sourceRunId: ${{ github.event.workflow_run.id }}
diff --git a/.github/workflows/codeql-cancel.yml 
b/.github/workflows/codeql-cancel.yml
index 216fed1..6834898 100644
--- a/.github/workflows/codeql-cancel.yml
+++ b/.github/workflows/codeql-cancel.yml
@@ -12,7 +12,7 @@ jobs:
     if: github.repository == 'apache/airflow' || 
github.event.workflow_run.event != 'schedule'
     steps:
       - name: "Cancel duplicated 'CodeQL' runs"
-        uses: potiuk/cancel-workflow-runs@v3
+        uses: 
potiuk/cancel-workflow-runs@ca4b70a6910d33990e16d95e0c116914cdc0dfd0 #v3_1
         id: cancel
         with:
           token: ${{ secrets.GITHUB_TOKEN }}

Reply via email to