From 2385b00af3dcf3427092c9f3e73db25c79ca9ffb Mon Sep 17 00:00:00 2001 From: jellespijker Date: Thu, 1 Sep 2022 09:33:23 +0200 Subject: [PATCH] Fixes external PR version Differentiate between internal actions and those of PR's This should fix the failing unit tests on forked PR --- .github/workflows/conan-recipe-version.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conan-recipe-version.yml b/.github/workflows/conan-recipe-version.yml index ddadfe1781..72dad25033 100644 --- a/.github/workflows/conan-recipe-version.yml +++ b/.github/workflows/conan-recipe-version.yml @@ -53,9 +53,18 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v3 + if: ${{ ! contains(github.event, 'pull_request') }} with: - ref: ${{ github.head_ref }} fetch-depth: 0 + ref: ${{ github.head_ref }} + + - name: Checkout repo PR + uses: actions/checkout@v3 + if: ${{ contains(github.event, 'pull_request') }} + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - name: Setup Python and pip uses: actions/setup-python@v4 @@ -106,7 +115,7 @@ jobs: else: channel = repo.active_branch.name.split("_")[0].replace("-", "_").lower() - if event_name == "pull_request": + if "pull_request" in event_name: channel = f"pr_{issue_number}" # %% Get the actual version