You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[chore][add-labels.sh] Trim label comment to fix matching (#34796)
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
[Example
failure](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/10494185404/job/29069879053),
because of [this
comment](#34792 (comment)).
The failure is happening because the match fails when the label has a
trailing newline.
Local test without fix:
```
$ export LABEL="os:windows
"
$ if [[ -v COMMON_LABELS["${LABEL}"] ]]; then echo "Hello"; fi
$
```
Local test with fix:
```
$ export LABEL="os:windows
"
$ LABEL=$(echo "${LABEL}" | tr -d '\n')
$ if [[ -v COMMON_LABELS["${LABEL}"] ]]; then echo "Hello"; fi
Hello
```
0 commit comments