You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2022/04/18 08:59:35 UTC

[cloudstack] branch main updated: .github: use pull_request_target which has access to token

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

rohit pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new dcb9143330 .github: use pull_request_target which has access to token
dcb9143330 is described below

commit dcb9143330ab1ce962d951eb6bc512c46dfed214
Author: Rohit Yadav <ro...@shapeblue.com>
AuthorDate: Mon Apr 18 14:28:05 2022 +0530

    .github: use pull_request_target which has access to token
    
    This tries to add support for forked repo pull requests, to be able
    to run quality checks on it and send comments on the PR. Hopefully,
    this solves the issues faced recently.
    
    Due to the way pull_request_target works, I can't send this as a PR
    so committing directly to `main` and then sending a dummy PR from a fork
    to test if it works as documented by github and elsewhere.
    
    Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
---
 .github/workflows/coverage-check.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/coverage-check.yml b/.github/workflows/coverage-check.yml
index 097a49a9ba..00d1c975fa 100644
--- a/.github/workflows/coverage-check.yml
+++ b/.github/workflows/coverage-check.yml
@@ -17,7 +17,7 @@
 
 name: PR Quality Check
 
-on: [pull_request]
+on: [pull_request_target]
 
 jobs:
   build:
@@ -25,6 +25,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
+        with:
+          ref: "refs/pull/${{ github.event.number }}/merge"
 
       - name: Changed Java Files
         id: java-changes