Skip to content

Commit 838b0e5

Browse files
authored
[chore] add shellcheck CI script (aws-observability#396)
* [chore] add shellcheck CI script * sudo to install shellcheck, perhaps? * Fix shellcheck quoting issues and ignore .github/workflows too
1 parent f381863 commit 838b0e5

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

.github/workflows/ci-shellcheck.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Continuous Build (shellcheck)"
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
shellcheck:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
11+
- name: Install shell check
12+
run: sudo apt update && sudo apt install --assume-yes shellcheck
13+
14+
- name: Run shellcheck
15+
run: >-
16+
find . -type f |
17+
grep -v '.git' |
18+
xargs -n 30 file |
19+
grep -i shell |
20+
awk -F':' '{print $1}' |
21+
xargs shellcheck
22+

python/src/otel/otel_sdk/otel-instrument

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,19 @@ export PYTHONPATH="$LAMBDA_RUNTIME_DIR:$PYTHONPATH";
8989

9090
# - Set the trace exporter
9191

92-
if [ -z ${OTEL_TRACES_EXPORTER} ]; then
92+
if [ -z "${OTEL_TRACES_EXPORTER}" ]; then
9393
export OTEL_TRACES_EXPORTER=otlp_proto_http;
9494
fi
9595

9696
# - Set the metrics exporter
9797

98-
if [ -z ${OTEL_METRICS_EXPORTER} ]; then
98+
if [ -z "${OTEL_METRICS_EXPORTER}" ]; then
9999
export OTEL_METRICS_EXPORTER=none;
100100
fi
101101

102102
# - Set the service name
103103

104-
if [ -z ${OTEL_SERVICE_NAME} ]; then
104+
if [ -z "${OTEL_SERVICE_NAME}" ]; then
105105
export OTEL_SERVICE_NAME=$AWS_LAMBDA_FUNCTION_NAME;
106106
fi
107107

@@ -135,7 +135,7 @@ fi
135135

136136
export LAMBDA_RESOURCE_ATTRIBUTES="cloud.region=$AWS_REGION,cloud.provider=aws,faas.name=$AWS_LAMBDA_FUNCTION_NAME,faas.version=$AWS_LAMBDA_FUNCTION_VERSION";
137137

138-
if [ -z ${OTEL_RESOURCE_ATTRIBUTES} ]; then
138+
if [ -z "${OTEL_RESOURCE_ATTRIBUTES}" ]; then
139139
export OTEL_RESOURCE_ATTRIBUTES=$LAMBDA_RESOURCE_ATTRIBUTES;
140140
else
141141
export OTEL_RESOURCE_ATTRIBUTES="$LAMBDA_RESOURCE_ATTRIBUTES,$OTEL_RESOURCE_ATTRIBUTES";

0 commit comments

Comments
 (0)