From c252ad1428974383b834842983200b319837fa76 Mon Sep 17 00:00:00 2001 From: Piotr Halama Date: Wed, 20 Nov 2024 07:41:48 +0100 Subject: [PATCH 1/2] remove rebase action --- .github/actions/rebase/action.yaml | 37 ------------------- .github/workflows/gitleaks.yaml | 8 ++-- .github/workflows/integration-tests-pull.yaml | 12 ++++-- .github/workflows/lint.yaml | 18 +++++---- .github/workflows/markdown.yaml | 12 +++--- .github/workflows/unit-tests.yaml | 13 ++++--- 6 files changed, 39 insertions(+), 61 deletions(-) delete mode 100644 .github/actions/rebase/action.yaml diff --git a/.github/actions/rebase/action.yaml b/.github/actions/rebase/action.yaml deleted file mode 100644 index 1c84b38ac..000000000 --- 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/gitleaks.yaml b/.github/workflows/gitleaks.yaml index beeb7869c..b1f49a52b 100644 --- a/.github/workflows/gitleaks.yaml +++ b/.github/workflows/gitleaks.yaml @@ -11,12 +11,14 @@ 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 # Scan commits between base and head of the pull request run: ./gitleaks detect --log-opts=${PULL_BASE_SHA}...${PULL_HEAD_SHA} --verbose --redact - env: + env: PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }} - PULL_HEAD_SHA: ${{ github.event.pull_request.head.sha }} \ No newline at end of file + PULL_HEAD_SHA: ${{ github.event.pull_request.head.sha }} diff --git a/.github/workflows/integration-tests-pull.yaml b/.github/workflows/integration-tests-pull.yaml index b59529581..202af553a 100644 --- a/.github/workflows/integration-tests-pull.yaml +++ b/.github/workflows/integration-tests-pull.yaml @@ -3,8 +3,8 @@ name: integration tests (pull) on: pull_request: paths-ignore: - - 'docs/**' - - 'examples/**' + - "docs/**" + - "examples/**" types: [opened, reopened, synchronize, ready_for_review, converted_to_draft] jobs: @@ -13,7 +13,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 - uses: ./.github/actions/create-k3d-cluster - name: run test @@ -30,7 +32,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 - uses: ./.github/actions/create-k3d-cluster - name: run test diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 758ab891d..253261ec2 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -3,9 +3,9 @@ name: lint on: pull_request: paths: - - 'components/operator/**' - - 'components/serverless/**' - - '.github/**' + - "components/operator/**" + - "components/serverless/**" + - ".github/**" types: [opened, reopened, synchronize, ready_for_review, converted_to_draft] jobs: @@ -13,21 +13,25 @@ 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 - uses: golangci/golangci-lint-action@v3 with: version: latest - working-directory: 'components/operator' + working-directory: "components/operator" serverless-lint: 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 - uses: ./.github/actions/setup-libgit2 - uses: golangci/golangci-lint-action@v3 with: version: latest - working-directory: 'components/serverless' + working-directory: "components/serverless" diff --git a/.github/workflows/markdown.yaml b/.github/workflows/markdown.yaml index 56f2ed037..53a223d91 100644 --- a/.github/workflows/markdown.yaml +++ b/.github/workflows/markdown.yaml @@ -9,11 +9,13 @@ 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: gaurav-nelson/github-action-markdown-link-check@v1 with: - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' - config-file: '.mlc.config.json' - folder-path: '.' + use-quiet-mode: "yes" + use-verbose-mode: "yes" + config-file: ".mlc.config.json" + folder-path: "." max-depth: -1 diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index a11447af0..49b7ddacf 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -3,8 +3,8 @@ name: unit tests on: pull_request: paths-ignore: - - 'docs/**' - - 'examples/**' + - "docs/**" + - "examples/**" types: [opened, reopened, synchronize, ready_for_review, converted_to_draft] jobs: @@ -12,7 +12,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: run test run: make -C components/operator test @@ -21,9 +23,10 @@ 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 - uses: ./.github/actions/setup-libgit2 - name: run test run: make -C components/serverless test - From 88171b038d1ebfe107678279b3b2ef2ccf956680 Mon Sep 17 00:00:00 2001 From: Piotr Halama Date: Wed, 20 Nov 2024 08:30:22 +0100 Subject: [PATCH 2/2] retrigger jobs