Skip to content

Commit 60733a0

Browse files
zakiskchmouel
authored andcommitted
Obscure smee url from generated logs
obscured smee url from generated logs in CI. Signed-off-by: Zaki Shaikh <[email protected]>
1 parent f16dfed commit 60733a0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/kind-e2e-tests.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ jobs:
108108
- name: Collect logs
109109
if: ${{ always() }}
110110
run: |
111-
./hack/gh-workflow-ci.sh collect_logs
111+
./hack/gh-workflow-ci.sh collect_logs \
112+
"${{ secrets.TEST_GITEA_SMEEURL }}" \
113+
"${{ secrets.TEST_GITHUB_SECOND_SMEE_URL }}"
112114
113115
- name: Upload artifacts
114116
if: ${{ always() }}

hack/gh-workflow-ci.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ run_e2e_tests() {
125125
}
126126

127127
collect_logs() {
128+
test_gitea_smee_url="${1}"
129+
github_ghe_smee_url="${2}"
128130
mkdir -p /tmp/logs
129131
kind export logs /tmp/logs
130132
[[ -d /tmp/gosmee-replay ]] && cp -a /tmp/gosmee-replay /tmp/logs/
@@ -142,6 +144,11 @@ collect_logs() {
142144
done
143145
kubectl -n ${ns} get events >/tmp/logs/ns/${ns}/events
144146
done
147+
148+
for url in "${test_gitea_smee_url}" "${github_ghe_smee_url}"; do
149+
# shellcheck disable=SC2038
150+
find /tmp/logs -type f -exec grep -l "${url}" {} \; | xargs -r sed -i "s|${url}|SMEE_URL|g"
151+
done
145152
}
146153

147154
help() {
@@ -175,7 +182,7 @@ run_e2e_tests)
175182
run_e2e_tests "${2}" "${3}" "${4}" "${5}" "${6}" "${7}" "${8}" "${9}" "${10}" "${11}"
176183
;;
177184
collect_logs)
178-
collect_logs
185+
collect_logs "${2}" "${3}"
179186
;;
180187
help)
181188
help

0 commit comments

Comments
 (0)