Skip to content

Commit

Permalink
make change to update_generation_config.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWang1127 committed Dec 3, 2024
1 parent 779f42e commit a71b295
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
8 changes: 0 additions & 8 deletions .github/scripts/hermetic_library_generation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,8 @@ workspace_name="/workspace"
baseline_generation_config="baseline_generation_config.yaml"
message="chore: generate libraries at $(date)"

# there's no local branch when running in GitHub action,
# thus no need to use `git pull`.
git checkout "${target_branch}"
git checkout "${current_branch}"
# only allow fast-forward merging; exit with non-zero result if there's merging
# conflict.
if git merge -m "chore: merge ${target_branch} into ${current_branch}" "${target_branch}" -ne 0; then
echo "Merge ${target_branch} into ${current_branch} has conflict, exit."
exit 1
fi

# copy generation configuration from target branch to current branch.
git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}"
Expand Down
7 changes: 7 additions & 0 deletions .github/scripts/update_googleapis_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ else
gh pr checkout "${pr_num}"
fi

# only allow fast-forward merging; exit with non-zero result if there's merging
# conflict.
if git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}" -ne 0; then
echo "Merge ${base_branch} into ${current_branch} has conflict, exit."
exit 1
fi

mkdir tmp-googleapis
# use partial clone because only commit history is needed.
git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ else
gh pr checkout "${pr_num}"
fi

# Only allow fast-forward merging; exit with non-zero result if there's merging
# conflict.
if git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}" -ne 0; then
echo "Merge ${base_branch} into ${current_branch} has conflict, exit."
exit 1
fi

mkdir tmp-googleapis
# Use partial clone because only commit history is needed.
git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis
Expand Down

0 comments on commit a71b295

Please sign in to comment.