Skip to content

Commit

Permalink
create pr-checkout action
Browse files Browse the repository at this point in the history
  • Loading branch information
pPrecel committed May 7, 2024
1 parent 3010ed0 commit 3958744
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
15 changes: 15 additions & 0 deletions .github/actions/pr-checkout/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Checkout to PR and rebase to main'
description: 'Action for checkouting to the PR branch and rebasing it to the main'

runs:
using: 'composite'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Rebase to main
run: |
git rebase origin/main
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/markdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
documentation-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pr-checkout
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/operator-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pr-checkout
- uses: ./.github/actions/setup-go
- uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -30,7 +30,7 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pr-checkout
- uses: ./.github/actions/setup-go
- name: run test
run: make -C components/operator test
Expand All @@ -39,7 +39,7 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pr-checkout
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/create-single-cluster
- name: run integration test (pre)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-gitleaks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
gitleaks-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pr-checkout
with:
fetch-depth: 0
- name: Fetch gitleaks ${{ env.GITLEAKS_VERSION }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/serverless-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pr-checkout
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/setup-libgit2
- uses: golangci/golangci-lint-action@v3
Expand All @@ -31,7 +31,7 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pr-checkout
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/setup-libgit2
- name: run test
Expand All @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/pr-checkout
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/create-single-cluster
- name: run integration test (pre)
Expand Down

0 comments on commit 3958744

Please sign in to comment.