@@ -39,14 +39,6 @@ function safe_filename() {
39
39
echo " $1 " | sed ' s/[^a-zA-Z0-9.]/_/g'
40
40
}
41
41
42
- function git_with_error_handling() {
43
- if ! " $@ " ; then
44
- echo " Error executing git command: $* "
45
- return 1
46
- fi
47
- return 0
48
- }
49
-
50
42
function build_ref {
51
43
local ref=" $1 "
52
44
local output_dir=" $2 "
@@ -71,7 +63,7 @@ function main {
71
63
validate_root_dir
72
64
validate_max_depth
73
65
74
- git_with_error_handling git config --global --add safe.directory " $GITHUB_WORKSPACE "
66
+ git config --global --add safe.directory " $GITHUB_WORKSPACE " || true
75
67
76
68
# Save current state to restore later
77
69
local current_branch
@@ -123,13 +115,13 @@ function main {
123
115
local merge_branch=" temp-merge-$RANDOM "
124
116
git checkout -b " $merge_branch " " $base_ref_resolved " --quiet
125
117
126
- debug_log " Creating temporary merge of $head_ref_to_use into $base_ref_to_use (via $merge_branch )"
118
+ debug_log " Creating temporary merge of $head_ref_resolved into $base_ref_resolved (via $merge_branch )"
127
119
128
120
# Attempt to merge HEAD into BASE
129
- if ! git merge " $head_ref_to_use " --quiet; then
130
- echo " Merge conflict detected. Cannot automatically merge $head_ref_to_use into $base_ref_to_use ."
121
+ if ! git merge " $head_ref_resolved " --quiet; then
122
+ echo " Merge conflict detected. Cannot automatically merge $INPUT_HEAD_REF into $INPUT_BASE_REF ."
131
123
git merge --abort || true
132
- git checkout " $current_branch " --quiet || git checkout " $base_ref_to_use " --quiet || true
124
+ git checkout " $current_branch " --quiet || git checkout " $base_ref_resolved " --quiet || true
133
125
exit 1
134
126
fi
135
127
@@ -149,7 +141,7 @@ function main {
149
141
debug_log " ------------------------------------"
150
142
151
143
# Clean up temporary branches
152
- git checkout " $current_branch " --quiet || git checkout " $base_ref_to_use " --quiet || true
144
+ git checkout " $current_branch " --quiet || git checkout " $base_ref_resolved " --quiet || true
153
145
git branch -D " $merge_branch " --quiet || true
154
146
155
147
if [[ $diff_exit_code -eq 0 ]]; then
0 commit comments