diff --git a/.github/actions/rebase/action.yaml b/.github/actions/rebase/action.yaml deleted file mode 100644 index 1c84b38a..00000000 --- a/.github/actions/rebase/action.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: 'Rebase' -description: 'Action for rebasing to the main branch' - -runs: - using: 'composite' - steps: - - # Setup identity to avoid errors when git is trying to rebase without identity set - - name: Setup git identity - run: | - git config --global user.email "rebase@action.com" - git config --global user.name "Rebase Action" - shell: bash - - # Update origin/main branch locally to cover case when repo is not fully cloned - # for example when using `actions/checkout@v4` action with default `fetch-depth` value (1) - # read more: https://github.com/actions/checkout?tab=readme-ov-file#usage - - name: Update origin/main - run: | - git fetch origin main - git checkout origin/main - git checkout -B main - git pull --unshallow origin main - - # go back to the HEAD commit - git switch --detach ${{ github.sha }} - shell: bash - - - name: Rebase to main - run: | - git rebase main - shell: bash - - - name: Print branch log - run: | - git log origin/main~1.. - shell: bash diff --git a/.github/workflows/_build.yaml b/.github/workflows/_build.yaml index 2e914829..82b1f971 100644 --- a/.github/workflows/_build.yaml +++ b/.github/workflows/_build.yaml @@ -20,6 +20,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - if: ${{ !startsWith(github.event_name, 'pull_request') }} name: Get the latest tag id: get_tag diff --git a/.github/workflows/_gitleaks.yaml b/.github/workflows/_gitleaks.yaml index 05083475..dcec0d5a 100644 --- a/.github/workflows/_gitleaks.yaml +++ b/.github/workflows/_gitleaks.yaml @@ -10,7 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/rebase + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - name: Fetch gitleaks ${{ env.GITLEAKS_VERSION }} run: curl -Lso gitleaks.tar.gz https://github.com/gitleaks/gitleaks/releases/download/v${{ env.GITLEAKS_VERSION }}/gitleaks_${{ env.GITLEAKS_VERSION }}_linux_x64.tar.gz && tar -xvzf ./gitleaks.tar.gz - name: Run gitleaks diff --git a/.github/workflows/_integration-tests.yaml b/.github/workflows/_integration-tests.yaml index cc96a88f..85acdd04 100644 --- a/.github/workflows/_integration-tests.yaml +++ b/.github/workflows/_integration-tests.yaml @@ -18,7 +18,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/rebase + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - uses: ./.github/actions/create-k3d-cluster - uses: ./.github/actions/setup-go - name: run test diff --git a/.github/workflows/_unit-tests.yaml b/.github/workflows/_unit-tests.yaml index 5b6af0ef..eea4a8dd 100644 --- a/.github/workflows/_unit-tests.yaml +++ b/.github/workflows/_unit-tests.yaml @@ -8,7 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/rebase + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - uses: ./.github/actions/setup-go - name: fmt and unit tests run: make verify diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index d7553929..7ac876d4 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -11,7 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/rebase - uses: ./.github/actions/setup-go - uses: golangci/golangci-lint-action@v3 with: