Skip to content

Commit

Permalink
create rebase action
Browse files Browse the repository at this point in the history
  • Loading branch information
pPrecel committed May 9, 2024
1 parent 4177a0c commit 01c6564
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/actions/rebase/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Rebase'
description: 'Action for rebasing to the main branch'

runs:
using: 'composite'
steps:

- name: Update origin/main
run: |
git fetch origin main
git checkout --track origin/main
git pull --unshallow origin main
git switch --detach -
shell: bash

- name: Rebase to main
run: |
git rebase main
shell: bash

- name: Print branch log
run: |
git log origin/main~1..
shell: bash
3 changes: 1 addition & 2 deletions .github/workflows/gitleaks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/rebase
- 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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integration-tests-pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/create-single-cluster
- name: run test
Expand All @@ -28,6 +29,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/create-single-cluster
- name: run test
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ 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:
Expand All @@ -23,6 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/setup-libgit2
- uses: golangci/golangci-lint-action@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/markdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- uses: ./.github/actions/setup-go
- name: run test
run: make -C components/operator test
Expand All @@ -20,6 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/setup-libgit2
- name: run test
Expand Down

0 comments on commit 01c6564

Please sign in to comment.