You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2023/04/05 12:34:59 UTC

[GitHub] [flink-connector-pulsar] tisonkun commented on a diff in pull request #42: [hotfix] Improve CI trigger and cancel strategy

tisonkun commented on code in PR #42:
URL: https://github.com/apache/flink-connector-pulsar/pull/42#discussion_r1158458522


##########
.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

Review Comment:
   Isn't here appended a newline?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org