Skip to content

Commit 6dfec66

Browse files
authored
build: lint bash files (#20)
* build: lint bash files * chore: add shebang
1 parent 2a48729 commit 6dfec66

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
time: "08:00"
8+
timezone: "America/New_York"

.github/workflows/linting.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: tizen-build-action lint
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
bash-lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: Lint Bash
14+
uses: azohra/shell-linter@latest
15+
with:
16+
path: '*.sh'

build.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
#
23
# Set up Tizen Studio
34
#
@@ -6,7 +7,7 @@ INSTALLER="$GITHUB_WORKSPACE/tizen-studio_5.1.bin"
67

78
wget -nc -O "$INSTALLER" http://download.tizen.org/sdk/Installer/tizen-studio_5.1/web-cli_Tizen_Studio_5.1_ubuntu-64.bin
89
chmod a+x "$INSTALLER"
9-
"$INSTALLER" --accept-license $TIZEN_STUDIO
10+
"$INSTALLER" --accept-license "$TIZEN_STUDIO"
1011

1112
PATH="$TIZEN_STUDIO/tools/ide/bin:$PATH"
1213

@@ -21,7 +22,7 @@ fi
2122

2223
PROJECT_DIR="$1"
2324

24-
if [ ! -z $2 ]; then
25+
if [ -n "$2" ]; then
2526
CUSTOM_AUTHOR_CERT="$GITHUB_WORKSPACE/author-cert.cer"
2627
echo -n "$2" | base64 -d >"$CUSTOM_AUTHOR_CERT"
2728
fi
@@ -33,14 +34,14 @@ echo -n "$3" | base64 -d >"$AUTHOR_KEY"
3334

3435
AUTHOR_PASSWORD="$4"
3536

36-
if [ ! -z $5 ]; then
37+
if [ -n "$5" ]; then
3738
CUSTOM_DISTRIBUTOR_CERT="$GITHUB_WORKSPACE/distributor-cert.cer"
3839
echo -n "$5" | base64 -d >"$CUSTOM_DISTRIBUTOR_CERT"
3940
fi
4041
DEFAULT_DISTRIBUTOR_CERT="$TIZEN_STUDIO/tools/certificate-generator/certificates/distributor/sdk-$PRIVILEGE/tizen-distributor-ca.cer"
4142
DISTRIBUTOR_CERT="${CUSTOM_DISTRIBUTOR_CERT:-"$DEFAULT_DISTRIBUTOR_CERT"}"
4243

43-
if [ ! -z $6 ]; then
44+
if [ -n "$6" ]; then
4445
CUSTOM_DISTRIBUTOR_KEY="$GITHUB_WORKSPACE/distributor-key.p12"
4546
echo -n "$6" | base64 -d >"$CUSTOM_DISTRIBUTOR_KEY"
4647
fi
@@ -49,7 +50,7 @@ DISTRIBUTOR_KEY="${CUSTOM_DISTRIBUTOR_KEY:-"$DEFAULT_DISTRIBUTOR_KEY"}"
4950

5051
DISTRIBUTOR_PASSWORD="${7:-tizenpkcs12passfordsigner}"
5152

52-
echo <<EOF
53+
cat <<EOF
5354
Build and signing parameters:
5455
- project-dir: $PROJECT_DIR
5556
- author-cert: $AUTHOR_CERT
@@ -86,9 +87,10 @@ ERROR_LOG="$GITHUB_WORKSPACE/tizen-studio-data/cli/logs/cli.log"
8687
tizen build-web -- "$PROJECT_DIR" \
8788
&& tizen package -t wgt -s sourcetoad-tizen-public -o "$PACKAGE_OUTPUT_PATH" -- "$PROJECT_DIR/.buildResult"
8889

90+
# shellcheck disable=SC2181
8991
if [ $? -eq 0 ]; then
9092
SUCCESS=true
91-
echo "package-artifact=$PACKAGE_OUTPUT_PATH" >> $GITHUB_OUTPUT
93+
echo "package-artifact=$PACKAGE_OUTPUT_PATH" >> "$GITHUB_OUTPUT"
9294
else
9395
SUCCESS=false
9496
cat "$ERROR_LOG"

0 commit comments

Comments
 (0)