From 1b23988adc873cf4c1b757e592f265b8cde98d8c Mon Sep 17 00:00:00 2001 From: masamallow <77992722+masamallow@users.noreply.github.com> Date: Sun, 5 May 2024 19:08:13 +0900 Subject: [PATCH 1/7] Add Shellcheck GitHub Actions --- .github/workflows/static-analysis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/static-analysis.yml diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 0000000..dfb53d1 --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,12 @@ +name: Static Analysis +on: + pull_request: + paths: + - '**.sh' +jobs: + shellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run Shellcheck + run: shellcheck *.sh From 3cfaabe61d2ee618e840e15d4846feddc853e660 Mon Sep 17 00:00:00 2001 From: masamallow <77992722+masamallow@users.noreply.github.com> Date: Mon, 6 May 2024 01:54:01 +0900 Subject: [PATCH 2/7] Trial by manual execution --- .github/workflows/static-analysis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index dfb53d1..39d85e7 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -3,6 +3,7 @@ on: pull_request: paths: - '**.sh' + workflow_dispatch: jobs: shellcheck: runs-on: ubuntu-latest From 0bfa3bd6d1d9bba6cba78074192e09aa9c0ddd56 Mon Sep 17 00:00:00 2001 From: masamallow <77992722+masamallow@users.noreply.github.com> Date: Mon, 6 May 2024 02:08:14 +0900 Subject: [PATCH 3/7] sample param --- .github/workflows/static-analysis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 39d85e7..2b1e5fe 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -4,6 +4,10 @@ on: paths: - '**.sh' workflow_dispatch: + inputs: + exam: + description: 'trial' + required: false jobs: shellcheck: runs-on: ubuntu-latest From 09b009407023d0251d25e965a6f1026937d8146b Mon Sep 17 00:00:00 2001 From: masamallow <77992722+masamallow@users.noreply.github.com> Date: Mon, 6 May 2024 02:13:07 +0900 Subject: [PATCH 4/7] fix for exam --- .github/workflows/static-analysis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 2b1e5fe..89896f3 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,13 +1,11 @@ name: Static Analysis on: + push: + branches: + - chore/add-shellcheck-github-actions pull_request: paths: - '**.sh' - workflow_dispatch: - inputs: - exam: - description: 'trial' - required: false jobs: shellcheck: runs-on: ubuntu-latest From 27f9ba2f18ab28f16fafdf30d3da6e448a08e9c4 Mon Sep 17 00:00:00 2001 From: masamallow <77992722+masamallow@users.noreply.github.com> Date: Mon, 6 May 2024 02:44:12 +0900 Subject: [PATCH 5/7] search recursively --- .github/workflows/static-analysis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 89896f3..e466b7b 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -12,4 +12,6 @@ jobs: steps: - uses: actions/checkout@v4 - name: Run Shellcheck - run: shellcheck *.sh + run: | + shopt -s nullglob dotglob + shellcheck **.sh From be6a7a2f1ba8c0477bdd4b98f41f3c00ddb07c79 Mon Sep 17 00:00:00 2001 From: masamallow <77992722+masamallow@users.noreply.github.com> Date: Mon, 6 May 2024 03:10:03 +0900 Subject: [PATCH 6/7] modify for only commands --- .github/workflows/static-analysis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index e466b7b..6bbe713 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,17 +1,17 @@ -name: Static Analysis +name: Static Analysis for Commands on: push: branches: - chore/add-shellcheck-github-actions pull_request: paths: - - '**.sh' + - 'commands/**.sh' jobs: - shellcheck: + lint-commands: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Run Shellcheck + - name: Shellcheck for commands run: | shopt -s nullglob dotglob - shellcheck **.sh + shellcheck commands/**.sh From 24e3f00a99fc4f6545df8b2b43d40737e43bafef Mon Sep 17 00:00:00 2001 From: masamallow <77992722+masamallow@users.noreply.github.com> Date: Mon, 6 May 2024 03:33:28 +0900 Subject: [PATCH 7/7] delete trial code --- .github/workflows/static-analysis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 6bbe713..74b5f62 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,8 +1,5 @@ name: Static Analysis for Commands on: - push: - branches: - - chore/add-shellcheck-github-actions pull_request: paths: - 'commands/**.sh'