@@ -83,7 +83,14 @@ collapse_older_pipelines_notes() {
83
83
if [[ " $note_body " =~ " <details open>" ]]; then
84
84
echo " Removing open directive from note body"
85
85
collapsed_body=$( sed ' s/<details open>/<details>/' <<< " $note_body" )
86
- glab api " projects/$CI_PROJECT_ID /merge_requests/$merge_request_id /notes/$note_id " --method PUT --raw-field " body=$collapsed_body " --silent
86
+ # Write the content to a file to prevent going over the command line length capacity
87
+ cat > /tmp/note_body.txt << EOF
88
+ $collapsed_body
89
+ EOF
90
+
91
+ # Use the --field flag combined with the @ syntax to pass the file content as the body
92
+ glab api " projects/$CI_PROJECT_ID /merge_requests/$merge_request_id /notes/$note_id " --method PUT --field " body=@/tmp/note_body.txt" --silent
93
+ rm -f /tmp/note_body.txt
87
94
fi
88
95
fi
89
96
done <<< " $notes_to_collapse"
@@ -127,7 +134,7 @@ credentials_log=$(mktemp -t pipelines-credentials-XXXXXXXX.log)
127
134
get_gruntwork_read_token () {
128
135
export PIPELINES_TOKEN_PATH=" pipelines-read/gruntwork-io"
129
136
SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd)
130
- node " $SCRIPT_DIR /pipelines-credentials.mjs" > " $credentials_log " 2>&1
137
+ node " $SCRIPT_DIR /pipelines-credentials.mjs" > " $credentials_log " 2>&1
131
138
# The node script writes the token to a file, so we need to source it to make it available
132
139
set -a
133
140
source credentials.sh
@@ -162,7 +169,7 @@ clone_log=$(mktemp -t pipelines-clone-XXXXXXXX.log)
162
169
set +e
163
170
git clone -b " $GRUNTWORK_PIPELINES_ACTIONS_REF " \
164
171
" https://oauth2:$PIPELINES_GRUNTWORK_READ_TOKEN @github.com:/gruntwork-io/pipelines-gitlab-actions.git" /tmp/pipelines-actions \
165
- > " $clone_log " 2>&1
172
+ > " $clone_log " 2>&1
166
173
clone_exit_code=$?
167
174
set -e
168
175
@@ -173,12 +180,11 @@ if [[ $clone_exit_code -ne 0 ]]; then
173
180
fi
174
181
echo " done."
175
182
176
-
177
183
echo -n " Installing Pipelines CLI... "
178
184
# Install the Pipelines CLI
179
185
install_log=$( mktemp -t pipelines-install-XXXXXXXX.log)
180
186
set +e
181
- /tmp/pipelines-actions/scripts/install-pipelines.sh > " $install_log " 2>&1
187
+ /tmp/pipelines-actions/scripts/install-pipelines.sh > " $install_log " 2>&1
182
188
install_exit_code=$?
183
189
set -e
184
190
0 commit comments