Skip to content

Commit 513cfb5

Browse files
authored
Add lint check (#5)
* Add lint check * update * update shellcheck to use master * fix error * disable shellscheck on script version * update comment * bumb version
1 parent 3ca0c88 commit 513cfb5

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

.github/workflows/check-version.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
branches:
66
- main
7+
paths:
8+
- 'sync-ssh-keys.sh'
9+
- 'users.conf'
710

811
jobs:
912
check-version:

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint Shell Script
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- 'sync-ssh-keys.sh'
9+
- '.github/workflows/lint.yml'
10+
11+
jobs:
12+
shellcheck:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Run ShellCheck
19+
uses: ludeeus/action-shellcheck@master
20+
with:
21+
scandir: .
22+
severity: warning

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- 'sync-ssh-keys.sh'
9+
- 'users.conf'
10+
workflow_dispatch:
711

812
jobs:
913
release:

sync-ssh-keys.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
SCRIPT_VERSION="0.0.4"
4+
# shellcheck disable=SC2034 # planned to be used in a future release
5+
SCRIPT_VERSION="0.0.5"
56

67
# === Load user configuration ===
78
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

0 commit comments

Comments
 (0)