Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: rebase before running samples check #252

Open
wants to merge 1 commit into
base: msft-main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions tests/git-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
set -o errexit
set -o nounset
set -o pipefail
set -x

function add_kata_bot_info() {
echo "Adding user name and email to the local git repo"
Expand All @@ -21,6 +22,7 @@ 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 fetch origin ${TARGET_BRANCH}
git rebase origin/${TARGET_BRANCH}
fi
}
Expand Down
Loading