You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ti...@apache.org on 2023/04/07 01:32:42 UTC

[flink-connector-pulsar] branch main updated: [hotfix] Improve CI trigger and cancel strategy (#42)

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

tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-connector-pulsar.git


The following commit(s) were added to refs/heads/main by this push:
     new e0de157  [hotfix] Improve CI trigger and cancel strategy (#42)
e0de157 is described below

commit e0de1577dcace6f0b5c9ee4478cfbd723545f13d
Author: tison <wa...@gmail.com>
AuthorDate: Fri Apr 7 09:32:37 2023 +0800

    [hotfix] Improve CI trigger and cancel strategy (#42)
    
    Signed-off-by: tison <wa...@gmail.com>
---
 .github/workflows/{push_pr.yml => ci.yml} | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/push_pr.yml b/.github/workflows/ci.yml
similarity index 61%
rename from .github/workflows/push_pr.yml
rename to .github/workflows/ci.yml
index 6d7b36c..01b5245 100644
--- a/.github/workflows/push_pr.yml
+++ b/.github/workflows/ci.yml
@@ -17,14 +17,33 @@
 ################################################################################
 
 name: CI
-on: [push, pull_request]
+on:
+  push:
+    branches:
+      - 'main'
+      - 'v*'
+  pull_request:
+    branches:
+      - 'main'
+      - 'v*'
+
+# Concurrency strategy:
+#   github.workflow: distinguish this workflow from others
+#   github.event_name: distinguish `push` event from `pull_request` event
+#   github.event.number: set to the number of the pull request if `pull_request` event
+#   github.run_id: otherwise, it's a `push` or `schedule` event, only cancel if we rerun the workflow
+#
+# Reference:
+#   https://docs.github.com/en/actions/using-jobs/using-concurrency
+#   https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
 concurrency:
-  group: ${{ github.workflow }}-${{ github.ref }}
+  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
   cancel-in-progress: true
+
 jobs:
   compile_and_test:
     uses: apache/flink-connector-shared-utils/.github/workflows/ci.yml@ci_utils
     with:
       flink_version: 1.17.0
       timeout_global: 80
-      timeout_test: 60
\ No newline at end of file
+      timeout_test: 60