Skip to content

Commit

Permalink
draft: add codeowners to gotestsum report
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahkm committed Jan 24, 2025
1 parent 700f43e commit 0a0acd6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/actions/add-codeowners/codeowners.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

temp_file="tempfile.xml"

while read p; do
if [[ "$p" =~ \<testcase.* ]]; then
class=$(echo "$p" | grep -o '.v1/[^"]*"')
file_name=$(echo "${class:3}" | sed 's/.$//') # trim off the edges to get the path
new_line=$(echo "$p" | sed "s|<testcase|<testcase file=\"$file_name\"|")
echo "$new_line" >> "$temp_file"
else
echo "$p" >> "$temp_file"
fi
done < ../../../gotestsum-report.xml

rm -f "$temp_file"

mv "$temp_file" ../../../gotestsum-report.xml
3 changes: 3 additions & 0 deletions .github/actions/dd-ci-upload/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ runs:
curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_${{ env.DD_CI_CLI_BUILD }}" --output datadog-ci
chmod +x datadog-ci
- name: Add CodeOwners to JUnit files
run: actions/add-codeowners/codeowners.sh

- name: Upload the JUnit files
shell: bash
run: |
Expand Down

0 comments on commit 0a0acd6

Please sign in to comment.