Skip to content

Commit 0cbdb0c

Browse files
authored
fix: codeowner script doesn't change directories as needed (#4108)
Co-authored-by: hannahs.kim <[email protected]>
1 parent 53b84e7 commit 0cbdb0c

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

.github/actions/add-codeowners/codeowners.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
#!/bin/bash
22

3+
RESULT_PATH="${1:-.}"
4+
if [ ! -d "$RESULT_PATH" ]; then
5+
echo "Error: Result path does not exist"
6+
exit 1
7+
fi
8+
9+
cd "$RESULT_PATH" || exit 1
10+
311
for file in gotestsum-report*.xml; do
4-
temp_file="tempfile.xml"
12+
# Skip if the glob didn't match any files
13+
[ -f "$file" ] || break
14+
15+
temp_file="${file}_tmp.xml"
516

617
# force write a new line at the end of the gotestsum-report.xml, or else
718
# the loop will skip the last line.
819
# fixes issue with a missing </testsuites>
9-
echo -e "\n" >> $file
20+
echo -e "\n" >> "$file"
1021

11-
while read p; do
22+
while IFS= read -r p || [ -n "$p" ]; do
1223
# we might try to report gotestsum-report.xml multiple times, so don't
1324
# calculate codeowners more times than we need
1425
if [[ "$p" =~ \<testcase && ! "$p" =~ "file=" ]]; then
@@ -22,7 +33,7 @@ for file in gotestsum-report*.xml; do
2233
else
2334
echo "$p" >> "$temp_file"
2435
fi
25-
done < $file
36+
done < "$file"
2637

27-
mv "$temp_file" $file
38+
mv "$temp_file" "$file"
2839
done

.github/actions/dd-ci-upload/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ runs:
4444
4545
- name: Add CodeOwners to JUnit files
4646
shell: bash
47-
run: ./.github/actions/add-codeowners/codeowners.sh
47+
run: ./.github/actions/add-codeowners/codeowners.sh "${{ inputs.path }}"
4848

4949
- name: Upload the JUnit files
5050
shell: bash

internal/orchestrion/_integration/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,8 +987,8 @@ github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARu
987987
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
988988
github.com/containerd/containerd v1.7.27 h1:yFyEyojddO3MIGVER2xJLWoCIn+Up4GaHFquP7hsFII=
989989
github.com/containerd/containerd v1.7.27/go.mod h1:xZmPnl75Vc+BLGt4MIfu6bp+fy03gdHAn9bz+FreFR0=
990-
github.com/containerd/containerd/api v1.9.0 h1:HZ/licowTRazus+wt9fM6r/9BQO7S0vD5lMcWspGIg0=
991-
github.com/containerd/containerd/api v1.9.0/go.mod h1:GhghKFmTR3hNtyznBoQ0EMWr9ju5AqHjcZPsSpTKutI=
990+
github.com/containerd/containerd/api v1.10.0 h1:5n0oHYVBwN4VhoX9fFykCV9dF1/BvAXeg2F8W6UYq1o=
991+
github.com/containerd/containerd/api v1.10.0/go.mod h1:NBm1OAk8ZL+LG8R0ceObGxT5hbUYj7CzTmR3xh0DlMM=
992992
github.com/containerd/continuity v0.4.4 h1:/fNVfTJ7wIl/YPMHjf+5H32uFhl63JucB34PlCpMKII=
993993
github.com/containerd/continuity v0.4.4/go.mod h1:/lNJvtJKUQStBzpVQ1+rasXO1LAWtUQssk28EZvJ3nE=
994994
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=

orchestrion/all/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ require (
115115
github.com/cloudwego/iasm v0.2.0 // indirect
116116
github.com/confluentinc/confluent-kafka-go v1.9.2 // indirect
117117
github.com/confluentinc/confluent-kafka-go/v2 v2.4.0 // indirect
118-
github.com/containerd/containerd/api v1.9.0 // indirect
118+
github.com/containerd/containerd/api v1.10.0 // indirect
119119
github.com/containerd/errdefs v1.0.0 // indirect
120120
github.com/containerd/platforms v0.2.1 // indirect
121121
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect

orchestrion/all/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,8 +985,8 @@ github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARu
985985
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
986986
github.com/containerd/containerd v1.7.27 h1:yFyEyojddO3MIGVER2xJLWoCIn+Up4GaHFquP7hsFII=
987987
github.com/containerd/containerd v1.7.27/go.mod h1:xZmPnl75Vc+BLGt4MIfu6bp+fy03gdHAn9bz+FreFR0=
988-
github.com/containerd/containerd/api v1.9.0 h1:HZ/licowTRazus+wt9fM6r/9BQO7S0vD5lMcWspGIg0=
989-
github.com/containerd/containerd/api v1.9.0/go.mod h1:GhghKFmTR3hNtyznBoQ0EMWr9ju5AqHjcZPsSpTKutI=
988+
github.com/containerd/containerd/api v1.10.0 h1:5n0oHYVBwN4VhoX9fFykCV9dF1/BvAXeg2F8W6UYq1o=
989+
github.com/containerd/containerd/api v1.10.0/go.mod h1:NBm1OAk8ZL+LG8R0ceObGxT5hbUYj7CzTmR3xh0DlMM=
990990
github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM=
991991
github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
992992
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=

0 commit comments

Comments
 (0)