Skip to content

Commit

Permalink
Merge branch '1.2' into 1
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 19, 2024
2 parents b431877 + d8e881f commit 1b8f937
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,18 @@ runs:
# when running a failed job though that's still a valid scenario
git checkout $FROM_BRANCH
git pull
FROM_BRANCH_SHA=$(git rev-parse HEAD)
echo "FROM_BRANCH $FROM_BRANCH sha is $FROM_BRANCH_SHA"
git checkout $INTO_BRANCH
git pull
INTO_BRANCH_SHA=$(git rev-parse HEAD)
echo "INTO_BRANCH $INTO_BRANCH sha is $INTO_BRANCH_SHA"
# If both branches are on the same sha, there's nothing to do
if [[ $FROM_BRANCH_SHA == $INTO_BRANCH_SHA ]]; then
echo "FROM_BRANCH $FROM_BRANCH and INTO_BRANCH $INTO_BRANCH have the same sha. Skipping."
continue
fi
# Determine if we will rebuild dist file during merge-up
# This is based simply on if there are changes in the client/ directory and if there's a package.json file
Expand All @@ -254,7 +264,7 @@ runs:
# `|| true is suffixed to the command to prevent the job from stopping on merge conflict
# This is because git will sent a non-zero exit code when there is a merge conflict
# We often expect a merge-conflict when there are client/dist file differences
git merge --no-ff --no-commit $FROM_BRANCH || true
MERGE_RESULT=$(git merge --no-ff --no-commit $FROM_BRANCH || true)
# Only merge conflicts in client/dist are allowed, stop for all others
# See https://git-scm.com/docs/git-status#_output for information on the porcelain format
Expand Down Expand Up @@ -377,9 +387,9 @@ runs:
exit 1
fi
# Continue if there's nothing to commit
if [[ $GIT_STATUS == "" ]]; then
echo "No changes found when merging-up $FROM_BRANCH into $INTO_BRANCH. Skipping."
# Things are update to up to date, so do not commit
if [[ $MERGE_RESULT =~ "Already up to date" ]]; then
echo "Merge result said things are already up to date when merging-up $FROM_BRANCH into $INTO_BRANCH. Skipping."
continue
fi
Expand Down

0 comments on commit 1b8f937

Please sign in to comment.