diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 0bc5df898..a165682c8 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v7 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} allow-unsafe-pr-checkout: true persist-credentials: false diff --git a/.github/workflows/build-distribution.yml b/.github/workflows/build-distribution.yml index 0cbe4751f..05f357fad 100644 --- a/.github/workflows/build-distribution.yml +++ b/.github/workflows/build-distribution.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v7 if: ${{ github.event.pull_request.head.sha }} with: - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} allow-unsafe-pr-checkout: true - uses: actions/checkout@v7 @@ -67,7 +67,7 @@ jobs: - uses: actions/checkout@v7 if: ${{ github.event.pull_request.head.sha }} with: - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} allow-unsafe-pr-checkout: true - uses: actions/checkout@v7 @@ -164,7 +164,7 @@ jobs: - uses: actions/checkout@v7 if: ${{ github.event.pull_request.head.sha }} with: - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} allow-unsafe-pr-checkout: true - uses: actions/checkout@v7 @@ -370,7 +370,7 @@ jobs: - uses: actions/checkout@v7 if: ${{ github.event.pull_request.head.sha }} with: - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} allow-unsafe-pr-checkout: true - uses: actions/checkout@v7 diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 83903cd45..545d4ca64 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -9,7 +9,7 @@ jobs: - name: Fetch code uses: actions/checkout@v7 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} allow-unsafe-pr-checkout: true fetch-depth: 0 diff --git a/.github/workflows/doc-check.yml b/.github/workflows/doc-check.yml index 8d2a02048..cffbb4f02 100644 --- a/.github/workflows/doc-check.yml +++ b/.github/workflows/doc-check.yml @@ -59,7 +59,7 @@ jobs: - uses: actions/checkout@v7 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} allow-unsafe-pr-checkout: true persist-credentials: false diff --git a/.github/workflows/dtk-unittest.yml b/.github/workflows/dtk-unittest.yml index e4c3c45be..d31d1fe13 100644 --- a/.github/workflows/dtk-unittest.yml +++ b/.github/workflows/dtk-unittest.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v7 if: ${{ github.event.pull_request.head.sha }} with: - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} allow-unsafe-pr-checkout: true - uses: actions/checkout@v7 diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml index a74b6accf..bd7544b6d 100644 --- a/.github/workflows/license-check.yml +++ b/.github/workflows/license-check.yml @@ -9,7 +9,7 @@ jobs: with: # fetch-depth: 0 必不可少,否则 git diff 找不到对比基准 fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} allow-unsafe-pr-checkout: true @@ -117,7 +117,7 @@ jobs: steps: - uses: actions/checkout@v7 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} allow-unsafe-pr-checkout: true - name: Install zsh @@ -150,7 +150,7 @@ jobs: - uses: actions/checkout@v7 with: fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} allow-unsafe-pr-checkout: true - uses: zccrs/github-actions-spdx-checker@main diff --git a/workflow-templates/cppcheck.yml b/workflow-templates/cppcheck.yml index 7915f23a7..d1e8b0ab9 100644 --- a/workflow-templates/cppcheck.yml +++ b/workflow-templates/cppcheck.yml @@ -16,7 +16,7 @@ jobs: - run: export - uses: actions/checkout@v7 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: refs/heads/${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} allow-unsafe-pr-checkout: true persist-credentials: false