From 9ab2fd607700469e6ede7136e13f705ba815b606 Mon Sep 17 00:00:00 2001 From: Sebastian Gode Date: Thu, 25 Sep 2025 12:42:28 +0000 Subject: [PATCH] fix pull --- .gitea/workflows/run-hcdc.yaml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/run-hcdc.yaml b/.gitea/workflows/run-hcdc.yaml index 9fd1b8137..0b5ca0f4b 100644 --- a/.gitea/workflows/run-hcdc.yaml +++ b/.gitea/workflows/run-hcdc.yaml @@ -9,12 +9,24 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout PR head + - name: Checkout PR head (same repo) + if: ${{ gitea.event.pull_request.head.repo.full_name == gitea.repository }} uses: https://github.com/actions/checkout@v4 with: - repository: ${{ gitea.event.pull_request.head.repo.full_name }} + repository: ${{ gitea.repository }} ref: ${{ gitea.event.pull_request.head.ref }} fetch-depth: 0 + persist-credentials: false + token: ${{ gitea.token }} + + - name: Checkout PR head (fork via PR ref) + if: ${{ gitea.event.pull_request.head.repo.full_name != gitea.repository }} + uses: https://github.com/actions/checkout@v4 + with: + repository: ${{ gitea.repository }} + ref: refs/pull/${{ gitea.event.pull_request.number }}/head + fetch-depth: 0 + persist-credentials: false token: ${{ gitea.token }} - name: Checkout base @@ -24,9 +36,9 @@ jobs: ref: ${{ gitea.event.pull_request.base.ref }} path: base fetch-depth: 0 + persist-credentials: false token: ${{ gitea.token }} - - name: Get OTC token id: otc uses: https://github.com/opentelekomcloud-infra/github-actions/.github/actions/get-otc-token@v1 @@ -46,7 +58,7 @@ jobs: python-version: "3.12" - name: Comment in case there's an error - if: failure() + if: ${{ failure() && steps.hcdc.outcome == 'failure' }} env: GITEA_URL: ${{ gitea.server_url }} REPO: ${{ gitea.repository }}