Skip to content

Commit

Permalink
ci: rebase before running samples check
Browse files Browse the repository at this point in the history
This removes the need for PR author to rebase feature branch for updated samples in target branch, if any

Signed-off-by: Saul Paredes <[email protected]>
  • Loading branch information
Redent0r committed Nov 14, 2024
1 parent bc69b85 commit 452029d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/check-samples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
- name: Check out code
uses: actions/checkout@v4

- name: Rebase atop of the latest target branch
env:
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
run: |
./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch"
- name: Install yq
env:
INSTALL_IN_GOPATH: false
Expand Down
3 changes: 2 additions & 1 deletion tests/git-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ function rebase_atop_of_the_latest_target_branch() {
echo "Rebasing atop of the latest ${TARGET_BRANCH}"
# Recover from any previous rebase left halfway
git rebase --abort 2> /dev/null || true
git rebase origin/${TARGET_BRANCH}
git fetch origin "${TARGET_BRANCH}"
git rebase origin/"${TARGET_BRANCH}"
fi
}

Expand Down

0 comments on commit 452029d

Please sign in to comment.