File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5858 # Setup variables
5959 BUILD_BRANCH="build/${GITHUB_REF_NAME}"
6060 GITHUB_ACTION_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}/checks"
61+ SAFE_BRANCH_NAME="${BUILD_BRANCH//\//-}"
62+ DIFF_FILE="${RUNNER_TEMP}/${SAFE_BRANCH_NAME}.diff"
6163
6264 # Switch branches... maybe?
6365 git fetch --all
@@ -71,12 +73,11 @@ jobs:
7173 fi
7274
7375 # Capture diff of the changes between the two branches
74- git diff --no-color --binary --full-index ${BUILD_BRANCH} ${GITHUB_REF_NAME} > ~/${BUILD_BRANCH}.diff
76+ git diff --no-color --binary --full-index ${BUILD_BRANCH} ${GITHUB_REF_NAME} > "${DIFF_FILE}"
7577
76- # If the diff file is not empty then continue
77- if [ -s ~/${BUILD_BRANCH}.diff ]; then
78- # Apply changes to the build branch
79- git apply --index ~/${BUILD_BRANCH}.diff
78+ # If there are changes, apply & push
79+ if [ -s "${DIFF_FILE}" ]; then
80+ git apply --index "${DIFF_FILE}"
8081
8182 # Add file changes and commit
8283 git add .
You can’t perform that action at this time.
0 commit comments