Browse Source

Merge pull request #6782 from nielsvanvelzen/openapi-pr-target

Claus Vium 3 years ago
parent
commit
b64d9bcd40
1 changed files with 4 additions and 2 deletions
  1. 4 2
      .github/workflows/openapi.yml

+ 4 - 2
.github/workflows/openapi.yml

@@ -3,7 +3,7 @@ on:
   push:
   push:
     branches:
     branches:
       - master
       - master
-  pull_request:
+  pull_request_target:
 
 
 jobs:
 jobs:
   openapi-head:
   openapi-head:
@@ -12,6 +12,8 @@ jobs:
     steps:
     steps:
       - name: Checkout repository
       - name: Checkout repository
         uses: actions/checkout@v2
         uses: actions/checkout@v2
+        with:
+          ref: ${{ github.head_ref }}
       - name: Setup .NET Core
       - name: Setup .NET Core
         uses: actions/setup-dotnet@v1
         uses: actions/setup-dotnet@v1
         with:
         with:
@@ -53,7 +55,7 @@ jobs:
 
 
   openapi-diff:
   openapi-diff:
     name: OpenAPI - Difference
     name: OpenAPI - Difference
-    if: ${{ github.event_name == 'pull_request' }}
+    if: ${{ github.event_name == 'pull_request_target' }}
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     needs:
     needs:
       - openapi-head
       - openapi-head