Skip to content

Commit

Permalink
feat: add rebase actions and add to test workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mrCherry97 committed Nov 19, 2024
1 parent e4b18f6 commit 351900e
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/actions/rebase/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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 "[email protected]"
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 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
1 change: 1 addition & 0 deletions .github/workflows/pull-integration-cluster-k3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull-integration-namespace-k3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull-kyma-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- name: Install k3d
env:
K3D_URL: https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull-lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull-smoke-test-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- name: Install k3d
env:
K3D_URL: https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull-smoke-test-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- name: Install k3d
env:
K3D_URL: https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
with:
comment_on_pr: false
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- uses: actions/setup-node@v4
with:
node-version: 20
Expand Down

0 comments on commit 351900e

Please sign in to comment.