From 36516ca001daff0021fc6d6b194da40a5dbafdad Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Mon, 7 Apr 2025 19:18:19 +0200 Subject: [PATCH 1/5] ci: add CI/CD workflow for Bash scripts linting --- hooks/.forgejo/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 hooks/.forgejo/workflows/ci.yml diff --git a/hooks/.forgejo/workflows/ci.yml b/hooks/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..d0d7135 --- /dev/null +++ b/hooks/.forgejo/workflows/ci.yml @@ -0,0 +1,22 @@ +name: Bash Scripts CI/CD + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + workflow_dispatch: + # Allows manual triggering + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install shellcheck + run: sudo apt-get install -y shellcheck + + - name: Lint bash scripts + run: | + find . -type f -name "*.sh" -exec shellcheck {} \; -- 2.47.2 From 7abda2fcd464fb0b258bc60f44aa7c2321df46b9 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Mon, 7 Apr 2025 19:20:01 +0200 Subject: [PATCH 2/5] chore: rename CI workflow file path --- {hooks/.forgejo => .forgejo}/workflows/ci.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {hooks/.forgejo => .forgejo}/workflows/ci.yml (100%) diff --git a/hooks/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml similarity index 100% rename from hooks/.forgejo/workflows/ci.yml rename to .forgejo/workflows/ci.yml -- 2.47.2 From 77e03b9c1bc4b14d4d479a19092c61078b0f8ba8 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Mon, 7 Apr 2025 19:30:47 +0200 Subject: [PATCH 3/5] ci: update shellcheck installation method in CI config --- .forgejo/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index d0d7135..efce4bc 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -13,10 +13,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - + - name: Install shellcheck - run: sudo apt-get install -y shellcheck - + run: | + wget https://github.com/koalaman/shellcheck/releases/download/v0.9.4/shellcheck_0.9.4-1_amd64.deb + sudo apt-get install -y ./shellcheck_0.9.4-1_amd64.deb + rm shellcheck_0.9.4-1_amd64.deb + - name: Lint bash scripts run: | - find . -type f -name "*.sh" -exec shellcheck {} \; + find . -type f -name "*.sh" -print0 | xargs -0 shellcheck -- 2.47.2 From 22fc4f37ee3a88ce1d01776b1c9e280944c1982f Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Mon, 7 Apr 2025 19:31:54 +0200 Subject: [PATCH 4/5] ci: update shellcheck installation method in CI config --- .forgejo/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index efce4bc..a9e61b9 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -16,9 +16,10 @@ jobs: - name: Install shellcheck run: | - wget https://github.com/koalaman/shellcheck/releases/download/v0.9.4/shellcheck_0.9.4-1_amd64.deb - sudo apt-get install -y ./shellcheck_0.9.4-1_amd64.deb - rm shellcheck_0.9.4-1_amd64.deb + wget https://github.com/koalaman/shellcheck/releases/latest/download/shellcheck-latest.linux.x86_64.tar.xz + tar -xvf shellcheck-latest.linux.x86_64.tar.xz + sudo mv shellcheck /usr/local/bin + rm shellcheck-latest.linux.x86_64.tar.xz - name: Lint bash scripts run: | -- 2.47.2 From 29e77c8a4c78ff0882ac9b731f336bdf299aa8ea Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Mon, 7 Apr 2025 19:32:57 +0200 Subject: [PATCH 5/5] ci: update ShellCheck action and checkout version --- .forgejo/workflows/ci.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index a9e61b9..3f7ccba 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -12,15 +12,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Install shellcheck - run: | - wget https://github.com/koalaman/shellcheck/releases/latest/download/shellcheck-latest.linux.x86_64.tar.xz - tar -xvf shellcheck-latest.linux.x86_64.tar.xz - sudo mv shellcheck /usr/local/bin - rm shellcheck-latest.linux.x86_64.tar.xz - - - name: Lint bash scripts - run: | - find . -type f -name "*.sh" -print0 | xargs -0 shellcheck + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master -- 2.47.2