File tree Expand file tree Collapse file tree 2 files changed +45
-5
lines changed Expand file tree Collapse file tree 2 files changed +45
-5
lines changed Original file line number Diff line number Diff line change @@ -159,15 +159,35 @@ runs:
159
159
- name : Set outputs
160
160
run : |
161
161
set -euo pipefail
162
-
162
+
163
163
debug_log() {
164
164
if [ "${RUNNER_DEBUG:-0}" = "1" ]; then
165
165
echo "$1" | while IFS= read -r line; do
166
166
echo "##[debug]$line"
167
167
done
168
168
fi
169
169
}
170
-
170
+
171
+ log_content() {
172
+ local content="$1"
173
+ local label="${2:-}"
174
+
175
+ if [[ -n "$label" ]]; then
176
+ # Replace the beginning of each line with two spaces
177
+ local indented_content="${content//$'\n'/$'\n' }"
178
+ printf "%s:\n %s\n" "$label" "$indented_content"
179
+ else
180
+ echo "$content"
181
+ fi
182
+ }
183
+
184
+ log_output() {
185
+ echo ::group::Set outputs
186
+ log_content "$(cat "$GITHUB_OUTPUT")" "GITHUB_OUTPUT"
187
+ log_content "$(cat "$GITHUB_ENV")" "GITHUB_ENV"
188
+ echo ::endgroup::
189
+ }
190
+
171
191
set_output() {
172
192
local value="$1"
173
193
local output_key="$2"
@@ -189,5 +209,5 @@ runs:
189
209
190
210
image_value="${{ inputs.upload-name }}:${{ inputs.upload-tag }}"
191
211
set_output "$image_value" "image-name"
192
- debug_log "GitHub Output: $(cat "$GITHUB_OUTPUT")\nGitHub Env: $(cat "$GITHUB_ENV")"
212
+ log_output
193
213
shell : bash
Original file line number Diff line number Diff line change 31
31
done
32
32
fi
33
33
}
34
-
34
+
35
+ log_content() {
36
+ local content="$1"
37
+ local label="${2:-}"
38
+
39
+ if [[ -n "$label" ]]; then
40
+ # Replace the beginning of each line with two spaces
41
+ local indented_content="${content//$'\n'/$'\n' }"
42
+ printf "%s:\n %s\n" "$label" "$indented_content"
43
+ else
44
+ echo "$content"
45
+ fi
46
+ }
47
+
48
+ log_output() {
49
+ echo ::group::Set outputs
50
+ log_content "$(cat "$GITHUB_OUTPUT")" "GITHUB_OUTPUT"
51
+ log_content "$(cat "$GITHUB_ENV")" "GITHUB_ENV"
52
+ echo ::endgroup::
53
+ }
54
+
35
55
set_output() {
36
56
local value="$1"
37
57
local output_key="$2"
53
73
54
74
image_value="${{ inputs.download-name }}:${{ inputs.download-tag }}"
55
75
set_output "$image_value" "image-name"
56
- debug_log "GitHub Output: $(cat "$GITHUB_OUTPUT")\nGitHub Env: $(cat "$GITHUB_ENV")"
76
+ log_output
57
77
shell : bash
You can’t perform that action at this time.
0 commit comments