Skip to content

Commit 9530bc6

Browse files
committed
shellcheck
1 parent e480654 commit 9530bc6

File tree

5 files changed

+19
-21
lines changed

5 files changed

+19
-21
lines changed

.github/workflows/migrations.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ jobs:
183183
fi
184184
- name: Check version
185185
run: |
186-
./migrate.sh $svc desired
186+
./migrate.sh "$svc" desired
187187
if [ "$current" -ge "$(./migrate.sh $svc desired)" ]; then
188188
echo "Migrations must be newer than the version of staging! You probably lack behind, merge or rebase onto main first!"
189189
exit 1
@@ -192,11 +192,11 @@ jobs:
192192
current: ${{ steps.collect-version.outputs.VERSION }}
193193

194194
- name: Run UP migrations (1/2)
195-
run: ./migrate.sh $svc up
195+
run: ./migrate.sh "$svc" up
196196
- name: Generate schema.sql
197197
run: |
198198
/usr/lib/postgresql/15/bin/pg_dump \
199-
postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB \
199+
postgres://"$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB" \
200200
--schema-only -O > ./services/${{ matrix.service }}/schema.sql
201201
202202
sed 's/\(-- Dumped from database version [0-9]\+\.[0-9]\+\).*/\1/' -i ./services/${{ matrix.service }}/schema.sql
@@ -207,13 +207,13 @@ jobs:
207207
run: git diff --exit-code -- services/${{ matrix.service }} || (echo "You forgot to run ./models.sh before checking in" && exit 1)
208208
- name: Run DOWN migrations (1/2)
209209
run: |
210-
[ "$VERSION" -eq 0 ] && yes | ./migrate.sh $svc down || ./migrate.sh $svc goto $VERSION
210+
[ "$VERSION" -eq 0 ] && yes | ./migrate.sh "$svc" down || ./migrate.sh "$svc" goto "$VERSION"
211211
env:
212212
VERSION: ${{ steps.collect-version.outputs.VERSION }}
213213
- name: Run UP migrations (2/2)
214-
run: ./migrate.sh $svc up
214+
run: ./migrate.sh "$svc" up
215215
- name: Run DOWN migrations (2/2)
216216
run: |
217-
[ "$VERSION" -eq 0 ] && yes | ./migrate.sh $svc down || ./migrate.sh $svc goto $VERSION
217+
[ "$VERSION" -eq 0 ] && yes | ./migrate.sh "$svc" down || ./migrate.sh "$svc" goto "$VERSION"
218218
env:
219219
VERSION: ${{ steps.collect-version.outputs.VERSION }}

.github/workflows/publish-bufs.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,22 @@ jobs:
4444
id: breaking
4545
# We previously checked if any illegal breakage occurred, now check if we have breakage _at all_
4646
# If so, we publish this as a _major_ release
47-
run: buf breaking --against '.git#ref=HEAD^' && echo "breaking=false" >> $GITHUB_OUTPUT || echo "breaking=true" >> $GITHUB_OUTPUT
47+
run: buf breaking --against '.git#ref=HEAD^' && echo "breaking=false" >> "$GITHUB_OUTPUT" || echo "breaking=true" >> "$GITHUB_OUTPUT"
4848
- name: Has new package?
4949
id: new-package
5050
run: |
5151
last_tree=$(git ls-tree -d -r --name-only HEAD^ proto | sort) # directory tree of proto in old commit
5252
current_tree=$(find proto -type d | sort) # directory tree of proto right now
5353
new_dirs=$(comm -13 <(echo "$last_tree") <(echo "$current_tree")) # filter out lines, which are "-3": common (i.e. unchanged) or "-1": only in the last tree (i.e. removed)
54-
echo $new_dirs
54+
echo "$new_dirs"
5555
if [ -z "$new_dirs" ]; then
56-
echo "new-package=false" >> $GITHUB_OUTPUT
56+
echo "new-package=false" >> "$GITHUB_OUTPUT"
5757
else
58-
echo "new-package=true" >> $GITHUB_OUTPUT
58+
echo "new-package=true" >> "$GITHUB_OUTPUT"
5959
fi
6060
- name: Get SHA
6161
id: commit
62-
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
62+
run: echo "sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
6363
- name: Get Bump
6464
id: bump
6565
run: |
@@ -72,7 +72,7 @@ jobs:
7272
else
7373
BUMP="patch"
7474
fi
75-
echo "bump=$BUMP" >> $GITHUB_OUTPUT
75+
echo "bump=$BUMP" >> "$GITHUB_OUTPUT"
7676
env:
7777
BREAKING: ${{ steps.breaking.outputs.breaking }}
7878
NEW_PKG: ${{ steps.new-package.outputs.new-package }}
@@ -91,10 +91,10 @@ jobs:
9191
registry-url: 'https://registry.npmjs.org'
9292
- name: Fetch latest version from registry
9393
working-directory: gen/ts
94-
run: npm version $(npm view . version)
94+
run: npm version "$(npm view . version)"
9595
- name: Bump version
9696
working-directory: gen/ts
97-
run: npm version pre$BUMP --preid $SHA
97+
run: npm version "pre$BUMP" --preid "$SHA"
9898
env:
9999
BUMP: ${{ needs.check-preconditions.outputs.bump }}
100100
SHA: ${{ needs.check-preconditions.outputs.commit }}
@@ -137,9 +137,9 @@ jobs:
137137
BUMP: ${{ needs.check-preconditions.outputs.bump }}
138138
SHA: ${{ needs.check-preconditions.outputs.commit }}
139139
run: |
140-
VERSION=$(curl https://pub.dev/api/packages/helpwave_proto_dart -H "Accept: application/vnd.pub.v2+json" | jq ".latest.version" -r)
141-
NEW_VERSION=$(semver bump $BUMP $VERSION)
142-
NEW_VERSION=$(semver bump prerel $SHA $NEW_VERSION)
140+
VERSION=$(curl "https://pub.dev/api/packages/helpwave_proto_dart" -H "Accept: application/vnd.pub.v2+json" | jq ".latest.version" -r)
141+
NEW_VERSION=$(semver bump "$BUMP" "$VERSION")
142+
NEW_VERSION=$(semver bump prerel "$SHA" "$NEW_VERSION")
143143
sed "s/version:.*/version: $NEW_VERSION/" pubspec.yaml -i
144144
- name: Publish to pub.dev
145145
working-directory: gen/dart

.github/workflows/spicedb.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: actions/checkout@v4
2929
- name: Get zed
3030
run: |
31-
wget https://github.com/authzed/zed/releases/download/v${ZED_VERSION}/zed_${ZED_VERSION}_linux_amd64.deb -O zed.deb
31+
wget "https://github.com/authzed/zed/releases/download/v${ZED_VERSION}/zed_${ZED_VERSION}_linux_amd64.deb" -O zed.deb
3232
sudo apt install -y ./zed.deb
3333
- run: |
3434
go run cmd/spice/spice.go test

.golangci.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ linters:
88
- depguard # no need
99
- ireturn # no need
1010
- funlen # we tend to have long funlens, who cares?
11-
- execinquery # deprecated
1211
- goimports # unused
1312
- gochecknoglobals # we currently make use of globals
1413
- godot # petty linter
15-
- gomnd # deprecated
1614
- gomoddirectives # not needed
1715
- gofumpt # false positives
1816
- mnd # too many false-positives

images/dev-go/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ENV PATH="$PATH:$GOROOT/bin"
1414
# update debian package list and packages, also install some
1515
RUN apt update \
1616
&& apt upgrade -y \
17-
&& apt install sudo vim nano jq dnsutils postgresql-client lsb-release gpg redis-tools \
17+
&& apt install sudo vim nano jq dnsutils postgresql-client lsb-release gpg redis-tools shellcheck \
1818
apt-transport-https ca-certificates curl gnupg2 software-properties-common \
1919
-y \
2020
&& apt-get clean autoclean -y && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)