From c0eed2295a10a9722aab8b46840fce7b91300357 Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 25 Sep 2023 21:15:25 +0900 Subject: [PATCH 01/12] Create shellcheck.yml --- .github/workflows/shellcheck.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/shellcheck.yml diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 00000000..6bfc813a --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,28 @@ +name: shellcheck + +on: + pull_request: + paths: + - '**.sh' + +jobs: + shellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: changed shell scripts + id: changed-files + uses: tj-actions/changed-files@v39 + with: + files_yaml: | + shell: + - '**.sh' + + - name: run shellcheck for all changed shell scripts + if: steps.changed-files.outputs.shell_any_changed == 'true' + run: | + for file in ${{ steps.changed-files.outputs.shell_all_changed_files }}; do + echo "$file was changed" + shellcheck "$file" + done From 60b5a6e10b1597d76f0bb30d8f82527b0ad8fcbc Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 25 Sep 2023 21:17:47 +0900 Subject: [PATCH 02/12] Update shellcheck.yml --- .github/workflows/shellcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 6bfc813a..3beff73c 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -22,7 +22,7 @@ jobs: - name: run shellcheck for all changed shell scripts if: steps.changed-files.outputs.shell_any_changed == 'true' run: | - for file in ${{ steps.changed-files.outputs.shell_all_changed_files }}; do + for file in "${{ steps.changed-files.outputs.shell_all_changed_files }}"; do echo "$file was changed" shellcheck "$file" done From 4883269a2a3bc92a80c866a4a0eacff4cd2bff53 Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 25 Sep 2023 21:19:19 +0900 Subject: [PATCH 03/12] Update shellcheck.yml --- .github/workflows/shellcheck.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 3beff73c..968932db 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -21,8 +21,10 @@ jobs: - name: run shellcheck for all changed shell scripts if: steps.changed-files.outputs.shell_any_changed == 'true' + env: + CHANGED_FILES: ${{ steps.changed-files.outputs.shell_all_changed_files }} run: | - for file in "${{ steps.changed-files.outputs.shell_all_changed_files }}"; do + for file in "$CHANGED_FILES"; do echo "$file was changed" shellcheck "$file" done From 709e1d91b7b79ec2935ebe3d72d9fa422732c5a8 Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 25 Sep 2023 21:21:26 +0900 Subject: [PATCH 04/12] Create test.sh --- test.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.sh diff --git a/test.sh b/test.sh new file mode 100644 index 00000000..c5d6ef61 --- /dev/null +++ b/test.sh @@ -0,0 +1 @@ +echo "aaa" From ac74d5d0fa9a9ee210ee3b4317c56cae27294494 Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 25 Sep 2023 21:21:52 +0900 Subject: [PATCH 05/12] Create test-2.sh --- test-2.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 test-2.sh diff --git a/test-2.sh b/test-2.sh new file mode 100644 index 00000000..453ee75d --- /dev/null +++ b/test-2.sh @@ -0,0 +1 @@ +echo "2" From ea6133e5b9fb76a792f6657784f80fca7bb8ed4d Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 25 Sep 2023 21:23:27 +0900 Subject: [PATCH 06/12] Update shellcheck.yml --- .github/workflows/shellcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 968932db..de8cca94 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -9,7 +9,7 @@ jobs: shellcheck: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: changed shell scripts id: changed-files From 0d63866c7abff61cf3659df2d7f82152f135e7cc Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 25 Sep 2023 21:25:09 +0900 Subject: [PATCH 07/12] Update shellcheck.yml --- .github/workflows/shellcheck.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index de8cca94..7e02413c 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -21,10 +21,8 @@ jobs: - name: run shellcheck for all changed shell scripts if: steps.changed-files.outputs.shell_any_changed == 'true' - env: - CHANGED_FILES: ${{ steps.changed-files.outputs.shell_all_changed_files }} run: | - for file in "$CHANGED_FILES"; do + for file in ${{ steps.changed-files.outputs.shell_all_changed_files }}; do echo "$file was changed" shellcheck "$file" done From cd1e33b73c0edd627fc913bc9746fdc46dcbb26a Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 25 Sep 2023 21:28:00 +0900 Subject: [PATCH 08/12] Update test-2.sh --- test-2.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test-2.sh b/test-2.sh index 453ee75d..54c88f6a 100644 --- a/test-2.sh +++ b/test-2.sh @@ -1 +1,3 @@ -echo "2" +#!/bin/bash + +echo "test-2" From 6ef3dfa40ea0ac2b5fe628749af9cebd0ee6e380 Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 25 Sep 2023 21:28:17 +0900 Subject: [PATCH 09/12] Update test.sh --- test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test.sh b/test.sh index c5d6ef61..6e7fbe24 100644 --- a/test.sh +++ b/test.sh @@ -1 +1,3 @@ -echo "aaa" +#!/bin/bash + +echo "test" From 88b07496846787b062844ecfa70712823d4da18e Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 25 Sep 2023 21:30:29 +0900 Subject: [PATCH 10/12] Update shellcheck.yml --- .github/workflows/shellcheck.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 7e02413c..4a6f7c55 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -22,6 +22,7 @@ jobs: - name: run shellcheck for all changed shell scripts if: steps.changed-files.outputs.shell_any_changed == 'true' run: | + # shellcheck disable=SC2043 for file in ${{ steps.changed-files.outputs.shell_all_changed_files }}; do echo "$file was changed" shellcheck "$file" From 98abbec0975d3362398d904ec930b660b527909f Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 25 Sep 2023 21:37:44 +0900 Subject: [PATCH 11/12] Update shellcheck.yml --- .github/workflows/shellcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 4a6f7c55..1d014a25 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -22,7 +22,7 @@ jobs: - name: run shellcheck for all changed shell scripts if: steps.changed-files.outputs.shell_any_changed == 'true' run: | - # shellcheck disable=SC2043 + # shellcheck disable=SC2043 https://github.com/rhysd/actionlint/issues/355 for file in ${{ steps.changed-files.outputs.shell_all_changed_files }}; do echo "$file was changed" shellcheck "$file" From d6ab80be694bc4f0036e62fdb8597a42635accef Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 25 Sep 2023 21:38:44 +0900 Subject: [PATCH 12/12] Update shellcheck.yml --- .github/workflows/shellcheck.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 1d014a25..d5895911 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -22,7 +22,8 @@ jobs: - name: run shellcheck for all changed shell scripts if: steps.changed-files.outputs.shell_any_changed == 'true' run: | - # shellcheck disable=SC2043 https://github.com/rhysd/actionlint/issues/355 + # https://github.com/rhysd/actionlint/issues/355 + # shellcheck disable=SC2043 for file in ${{ steps.changed-files.outputs.shell_all_changed_files }}; do echo "$file was changed" shellcheck "$file"