From 09d058fb6c537f96766aa74c57fa0bf5a3eb2ab3 Mon Sep 17 00:00:00 2001 From: insleker Date: Tue, 16 Dec 2025 00:06:02 +0800 Subject: [PATCH] fix: update actions improved repository checkout configuration --- .github/workflows/pr-preview.yml | 7 ++++++- .github/workflows/pr-unit-tests.yml | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 9dff7d0..44233ff 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -19,7 +19,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 + with: + repository: ${{ github.repository }} + ref: refs/pull/${{ github.event.pull_request.number }}/merge + fetch-depth: 1 + persist-credentials: false - name: Setup Flutter if: github.event.action != 'closed' diff --git a/.github/workflows/pr-unit-tests.yml b/.github/workflows/pr-unit-tests.yml index ebc1359..38e9847 100644 --- a/.github/workflows/pr-unit-tests.yml +++ b/.github/workflows/pr-unit-tests.yml @@ -26,11 +26,18 @@ jobs: uses: actions/checkout@v6 continue-on-error: true id: checkout_https + with: + repository: ${{ github.repository }} + ref: refs/pull/${{ github.event.pull_request.number }}/merge + fetch-depth: 1 + persist-credentials: false - name: Checkout repository via SSH (fallback) if: steps.checkout_https.outcome == 'failure' uses: actions/checkout@v6 with: + repository: ${{ github.repository }} + ref: refs/pull/${{ github.event.pull_request.number }}/merge ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} ssh-strict: false