@@ -12,30 +12,30 @@ if [ -z "$PR_BRANCH" ] || [ -z "$TARGET_BRANCH" ]; then
12
12
fi
13
13
14
14
# Check if all branches exist
15
- git show-ref --verify --quiet refs/heads/$ PR_BRANCH
15
+ git show-ref --verify --quiet refs/heads/" ${ PR_BRANCH} "
16
16
if [ $? -ne 0 ]; then
17
17
echo " Branch ${PR_BRANCH} does not exist."
18
18
exit 1
19
19
fi
20
20
21
- git show-ref --verify --quiet refs/heads/$ TARGET_BRANCH
21
+ git show-ref --verify --quiet refs/heads/" ${ TARGET_BRANCH} "
22
22
if [ $? -ne 0 ]; then
23
23
echo " Branch ${TARGET_BRANCH} does not exist."
24
24
exit 1
25
25
fi
26
26
27
- git show-ref --verify --quiet refs/heads/$ NEXT_BRANCH
27
+ git show-ref --verify --quiet refs/heads/" ${ NEXT_BRANCH} "
28
28
if [ $? -ne 0 ] ; then
29
29
echo " Branch ${NEXT_BRANCH} does not exist."
30
30
exit 1
31
31
fi
32
32
33
33
34
34
# collect all static data fire before making alterations to the local and remote repositories
35
- PAST_VERSION=$( git describe --tags --abbrev=0 $ TARGET_BRANCH | awk -F ' -' ' {print $2}' )
35
+ PAST_VERSION=$( git describe --tags --abbrev=0 " ${ TARGET_BRANCH} " | awk -F ' -' ' {print $2}' )
36
36
if [ -z " $PAST_VERSION " ]; then
37
37
echo " Failed to get a CIQ Tag from ${TARGET_BRANCH} ."
38
- echo " LastTag: $( git describe --tags --abbrev=0 $ TARGET_BRANCH) "
38
+ echo " LastTag: $( git describe --tags --abbrev=0 " ${ TARGET_BRANCH} " ) "
39
39
exit 1
40
40
fi
41
41
# Check if PAST_VERSION matches the regex
@@ -48,10 +48,10 @@ PAST_VERSION_BRANCH="ciq-${PAST_VERSION}"
48
48
echo " PAST_VERSION: $PAST_VERSION "
49
49
echo " PAST_VERSION_BRANCH: $PAST_VERSION_BRANCH "
50
50
51
- NEW_GKH_TAG=$( git describe --tags --abbrev=0 $ PR_BRANCH | sed ' s/^.//g' )
51
+ NEW_GKH_TAG=$( git describe --tags --abbrev=0 " ${ PR_BRANCH} " | sed ' s/^.//g' )
52
52
if [ -z " $NEW_GKH_TAG " ]; then
53
53
echo " Failed to get a GKH Tag from ${PR_BRANCH} ."
54
- echo " LastTag: $( git describe --tags --abbrev=0 $ PR_BRANCH) "
54
+ echo " LastTag: $( git describe --tags --abbrev=0 " ${ PR_BRANCH} " ) "
55
55
exit 1
56
56
fi
57
57
# Check if NEW_GKH_TAG matches the regex
@@ -78,28 +78,28 @@ echo "git tag $NEW_CIQ_TAG $TARGET_BRANCH"
78
78
echo " git push origin $NEW_CIQ_TAG "
79
79
80
80
echo " git checkout $NEXT_BRANCH "
81
- git checkout $ NEXT_BRANCH
81
+ git checkout " ${ NEXT_BRANCH} "
82
82
if [ $? -ne 0 ]; then
83
83
echo " Failed to checkout ${NEXT_BRANCH} ."
84
84
exit 1
85
85
fi
86
86
87
87
echo " git pull origin $NEXT_BRANCH "
88
- git pull origin $ NEXT_BRANCH
88
+ git pull origin " ${ NEXT_BRANCH} "
89
89
if [ $? -ne 0 ]; then
90
90
echo " Failed to pull ${NEXT_BRANCH} ."
91
91
exit 1
92
92
fi
93
93
94
- echo " git merge --ff-only $PR_BRANCH "
95
- git merge --ff-only $ PR_BRANCH
94
+ echo " git merge --ff-only ${ PR_BRANCH} "
95
+ git merge --ff-only " ${ PR_BRANCH} "
96
96
if [ $? -ne 0 ]; then
97
97
echo " Failed to merge ${PR_BRANCH} into ${NEXT_BRANCH} ."
98
98
exit 1
99
99
fi
100
100
101
101
echo " git push origin $NEXT_BRANCH "
102
- git push origin $ NEXT_BRANCH
102
+ git push origin " ${ NEXT_BRANCH} "
103
103
if [ $? -ne 0 ]; then
104
104
echo " Failed to push ${NEXT_BRANCH} ."
105
105
exit 1
115
115
116
116
117
117
echo " git branch -m $TARGET_BRANCH $PAST_VERSION_BRANCH "
118
- git branch -m $ TARGET_BRANCH $ PAST_VERSION_BRANCH
118
+ git branch -m " ${ TARGET_BRANCH} " " ${ PAST_VERSION_BRANCH} "
119
119
if [ $? -ne 0 ]; then
120
120
echo " Failed to rename ${TARGET_BRANCH} to ${PAST_VERSION_BRANCH} ."
121
121
exit 1
122
122
fi
123
123
124
124
echo " git push origin :$TARGET_BRANCH $PAST_VERSION_BRANCH "
125
- git push origin :$ TARGET_BRANCH $ PAST_VERSION_BRANCH
125
+ git push origin :" ${ TARGET_BRANCH} " " ${ PAST_VERSION_BRANCH} "
126
126
if [ $? -ne 0 ]; then
127
127
echo " Failed to delete ${TARGET_BRANCH} ."
128
128
exit 1
129
129
fi
130
130
131
131
echo " git push origin -u $PAST_VERSION_BRANCH "
132
- git push origin -u $ PAST_VERSION_BRANCH
132
+ git push origin -u " ${ PAST_VERSION_BRANCH} "
133
133
if [ $? -ne 0 ]; then
134
134
echo " Failed to push ${PAST_VERSION_BRANCH} ."
135
135
exit 1
136
136
fi
137
137
138
138
echo " git branch -m $NEXT_BRANCH $TARGET_BRANCH "
139
- git branch -m $ NEXT_BRANCH $ TARGET_BRANCH
139
+ git branch -m " ${ NEXT_BRANCH} " " ${ TARGET_BRANCH} "
140
140
if [ $? -ne 0 ]; then
141
141
echo " Failed to rename ${NEXT_BRANCH} to ${TARGET_BRANCH} ."
142
142
exit 1
143
143
fi
144
144
145
145
echo " git push origin :$NEXT_BRANCH $TARGET_BRANCH "
146
- git push origin :$ NEXT_BRANCH $ TARGET_BRANCH
146
+ git push origin :" ${ NEXT_BRANCH} " " ${ TARGET_BRANCH} "
147
147
if [ $? -ne 0 ]; then
148
148
echo " Failed to delete ${NEXT_BRANCH} ."
149
149
exit 1
150
150
fi
151
151
152
152
echo " git push origin -u $TARGET_BRANCH "
153
- git push origin -u $ TARGET_BRANCH
153
+ git push origin -u " ${ TARGET_BRANCH} "
154
154
if [ $? -ne 0 ]; then
155
155
echo " Failed to push ${TARGET_BRANCH} ."
156
156
exit 1
157
157
fi
158
158
159
159
echo " git tag $NEW_CIQ_TAG $TARGET_BRANCH "
160
- git tag $ NEW_CIQ_TAG $ TARGET_BRANCH
160
+ git tag " ${ NEW_CIQ_TAG} " " ${ TARGET_BRANCH} "
161
161
if [ $? -ne 0 ]; then
162
162
echo " Failed to tag ${TARGET_BRANCH} with ${NEW_CIQ_TAG} ."
163
163
exit 1
164
164
fi
165
165
166
166
echo " git push origin $NEW_CIQ_TAG "
167
- git push origin $ NEW_CIQ_TAG
167
+ git push origin " ${ NEW_CIQ_TAG} "
168
168
if [ $? -ne 0 ]; then
169
169
echo " Failed to push ${NEW_CIQ_TAG} ."
170
170
exit 1
0 commit comments