Skip to content

Commit 413eef0

Browse files
committed
Make .devcontainer/boot.sh pass shellcheck
1 parent 2bc15d0 commit 413eef0

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

.devcontainer/boot.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
#!/bin/sh
2+
13
bundle install
24

35
if [ -n "${NVM_DIR}" ]; then
4-
. ${NVM_DIR}/nvm.sh && nvm install --lts
6+
# shellcheck disable=SC1091
7+
. "${NVM_DIR}/nvm.sh" && nvm install --lts
58
yarn install
69
fi
710

8-
cd activerecord
11+
cd activerecord || echo "activerecord directory doesn't exist" && exit
912

1013
# Create PostgreSQL databases
1114
bundle exec rake db:postgresql:rebuild
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Devcontainer Shellcheck
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".devcontainer/**/*.sh"
7+
push:
8+
paths:
9+
- ".devcontainer/**/*.sh"
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
devcontainer_shellcheck:
16+
name: Devcontainer Shellcheck
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout (GitHub)
20+
uses: actions/checkout@v4
21+
22+
- name: Lint Devcontainer Scripts
23+
run: |
24+
sudo apt install -y shellcheck
25+
find .devcontainer/ -name '*.sh' -print0 | xargs -0 shellcheck

.github/workflows/devcontainer-smoke-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ jobs:
1717
- name: Checkout (GitHub)
1818
uses: actions/checkout@v4
1919

20+
- name: Lint Entrypoint Script
21+
run: |
22+
sudo apt install -y shellcheck
23+
shellcheck .devcontainer/boot.sh
24+
2025
- name: Login to GitHub Container Registry
2126
uses: docker/login-action@v3
2227
with:

0 commit comments

Comments
 (0)