diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index af04ba8..4c4a629 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,11 +23,26 @@ jobs: name: SuperLinter πŸ¦ΈπŸ»β€β™€οΈ runs-on: ubuntu-latest steps: - - name: Checkout Repo πŸ›Ž - uses: actions/checkout@v5 + - 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: ${{ steps.branch-name.outputs.head_ref_branch }} + 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..a4a35cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,8 +30,25 @@ jobs: run: shell: bash steps: - - name: Checkout Repo πŸ›Ž - uses: actions/checkout@v5 + - 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: ${{ steps.branch-name.outputs.head_ref_branch }} + 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