]> sigrok.org Git - sigrok-build.git/commitdiff
build.yml: Check out PR instead of sigrok repo when needed
authorSoeren Apel <redacted>
Sun, 25 Aug 2024 21:06:10 +0000 (23:06 +0200)
committerSoeren Apel <redacted>
Sun, 25 Aug 2024 21:06:10 +0000 (23:06 +0200)
.github/workflows/build.yml

index 736d8c133d12da2affc636d7c21875ed876e45b9..37e64299ad818dc9dc72c48375f859e6104926bd 100644 (file)
@@ -353,12 +353,24 @@ jobs:
           source sigrok-appimage-init-toolchain.sh
           ./sigrok-appimage-build-dependencies.sh
 
-      - name: Checkout sigrok-cli
+      - name: Checkout sigrok's sigrok-cli
+        # Check out default sigrok-cli repository unless we're processing a pull request
+        if: (github.event_name != 'pull_request')
         uses: actions/checkout@v4
         with:
           repository: sigrokproject/sigrok-cli
           path: sigrok-cli
 
+      - name: Checkout sigrok-cli from PR
+        # Check out sigrok-cli branch of the pull request we're processing
+        if: (github.event_name == 'pull_request')
+        uses: actions/checkout@v4
+        with:
+          repository: ${{ github.event.pull_request.head.repo.full_name }}
+          ref: ${{ github.event.pull_request.head.ref }}
+          path: sigrok-cli
+          fetch-depth: 0
+
       - name: Build sigrok-cli
         run: |
           source sigrok-build/ci/appimage/sigrok-appimage-init-toolchain.sh