You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/01/08 08:37:34 UTC

[buildstream] branch bst-1 updated: .github/workflows/ci.yml: Configure CI to run from forked repos

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

tvb pushed a commit to branch bst-1
in repository https://gitbox.apache.org/repos/asf/buildstream.git


The following commit(s) were added to refs/heads/bst-1 by this push:
     new d962269  .github/workflows/ci.yml: Configure CI to run from forked repos
d962269 is described below

commit d962269cbc0a53ce9c35db5d2c868e9eb827d4b1
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Fri Jan 8 17:36:36 2021 +0900

    .github/workflows/ci.yml: Configure CI to run from forked repos
    
    Adapt a similar constraint as the master branch to allow CI to run
    on pull requests submitted from forked repositories.
---
 .github/workflows/ci.yml | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 793251a..8583083 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,11 +1,23 @@
 name: PR Checks
 
-# We don't run these jobs on pull requests because:
-# 1. it is often useful to run tests on one's branch without creating a pull
-#    request, and
-# 2. running on both pushes and pull requests results in the classic problem of
-#    having double jobs.
-on: push
+# Run the CI if branches are pushed locally, allowing us to
+# run CI without the need of creating a pull request.
+#
+# Run the CI on pull requests only if they are from forked
+# repositories.
+#
+on:
+  push:
+    branches-ignore:
+    - gh-pages
+  pull_request:
+    types: [assigned, opened, synchronize, reopened]
+    branches:
+      # Branches from forks have the form 'user:branch-name' so we only run
+      # this job on pull_request events for branches that look like fork
+      # branches. Without this we would end up running this job twice for non
+      # forked PRs, once for the push and then once for opening the PR.
+    - '**:**'
 
 env:
   CI_IMAGE: registry.gitlab.com/buildstream/buildstream-docker-images/testsuite-debian:10-master-132813612