From a1030303956abd4d604e766125f6083bb4769753 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Mon, 15 Dec 2025 09:51:51 +0100 Subject: [PATCH 1/3] chore: test checkout action --- .github/workflows/lint.yml | 14 ++++++++++++-- .github/workflows/test.yml | 16 ++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index af04ba8..770a912 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,11 +23,21 @@ jobs: name: SuperLinter πŸ¦ΈπŸ»β€β™€οΈ runs-on: ubuntu-latest steps: - - name: Checkout Repo πŸ›Ž - uses: actions/checkout@v5 + - name: Checkout repo (PR) πŸ›Ž + uses: actions/checkout@v4.1.1 + if: github.event_name == 'pull_request' with: + path: ${{ github.event.repository.name }} + repository: ${{ github.event.pull_request.head.repo.full_name }} fetch-depth: 0 + - name: Checkout repo πŸ›Ž + uses: actions/checkout@v4.1.1 + if: github.event_name != 'pull_request' + with: + ref: ${{ steps.branch-name.outputs.current_branch }} + path: ${{ github.event.repository.name }} + - name: Lint Code Base πŸ•΅πŸ»β€β™€οΈ uses: super-linter/super-linter/slim@v8 env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4a4e921..50453de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,8 +30,20 @@ jobs: run: shell: bash steps: - - name: Checkout Repo πŸ›Ž - uses: actions/checkout@v5 + - name: Checkout repo (PR) πŸ›Ž + uses: actions/checkout@v4.1.1 + if: github.event_name == 'pull_request' + with: + path: ${{ github.event.repository.name }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + fetch-depth: 0 + + - name: Checkout repo πŸ›Ž + uses: actions/checkout@v4.1.1 + if: github.event_name != 'pull_request' + with: + ref: ${{ steps.branch-name.outputs.current_branch }} + path: ${{ github.event.repository.name }} - name: Setup Go 🐹 uses: actions/setup-go@v6 From 30273b87f325a18080fb4c522642eaa5d6e307d9 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Mon, 15 Dec 2025 10:15:41 +0100 Subject: [PATCH 2/3] chore: add ref input --- .github/workflows/lint.yml | 1 + .github/workflows/test.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 770a912..53f898f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,6 +27,7 @@ jobs: uses: actions/checkout@v4.1.1 if: github.event_name == 'pull_request' with: + ref: ${{ github.event.pull_request.head.sha }} path: ${{ github.event.repository.name }} repository: ${{ github.event.pull_request.head.repo.full_name }} fetch-depth: 0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50453de..ba2c473 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,7 @@ jobs: uses: actions/checkout@v4.1.1 if: github.event_name == 'pull_request' with: + ref: ${{ github.event.pull_request.head.sha }} path: ${{ github.event.repository.name }} repository: ${{ github.event.pull_request.head.repo.full_name }} fetch-depth: 0 From 85472144bddd59f5ab5aa5d4df203f0eaba983ae Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Mon, 15 Dec 2025 10:27:51 +0100 Subject: [PATCH 3/3] chore: try head_ref_branch --- .github/workflows/lint.yml | 6 +++++- .github/workflows/test.yml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 53f898f..4c4a629 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,11 +23,15 @@ jobs: name: SuperLinter πŸ¦ΈπŸ»β€β™€οΈ runs-on: ubuntu-latest steps: + - name: Get branch names 🌿 + id: branch-name + uses: tj-actions/branch-names@v9.0.0 + - name: Checkout repo (PR) πŸ›Ž uses: actions/checkout@v4.1.1 if: github.event_name == 'pull_request' with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ steps.branch-name.outputs.head_ref_branch }} path: ${{ github.event.repository.name }} repository: ${{ github.event.pull_request.head.repo.full_name }} fetch-depth: 0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ba2c473..a4a35cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,11 +30,15 @@ jobs: run: shell: bash steps: + - name: Get branch names 🌿 + id: branch-name + uses: tj-actions/branch-names@v9.0.0 + - name: Checkout repo (PR) πŸ›Ž uses: actions/checkout@v4.1.1 if: github.event_name == 'pull_request' with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ steps.branch-name.outputs.head_ref_branch }} path: ${{ github.event.repository.name }} repository: ${{ github.event.pull_request.head.repo.full_name }} fetch-depth: 0