From cbc2973bc5797f1348f585077594ad436d38226c Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Tue, 27 Jun 2023 19:04:21 +0900 Subject: [PATCH] Integrate actionlint --- .github/workflows/actionlint.yml | 24 ++++++++++++++++++++++++ Makefile.toml | 8 ++++++++ default.nix | 1 + 3 files changed, 33 insertions(+) create mode 100644 .github/workflows/actionlint.yml diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml new file mode 100644 index 00000000..538fa8b8 --- /dev/null +++ b/.github/workflows/actionlint.yml @@ -0,0 +1,24 @@ +name: Lint GitHub Actions workflows +on: + push: + branches: + - main + paths: + - '.github/**' + pull_request: + paths: + - '.github/**' + workflow_dispatch: + +jobs: + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Download actionlint + id: get_actionlint + run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) + shell: bash + - name: Check workflow files + run: ${{ steps.get_actionlint.outputs.executable }} -color + shell: bash diff --git a/Makefile.toml b/Makefile.toml index eafca319..43ac96da 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -22,6 +22,9 @@ script = [ "dprint fmt", ] +[tasks.fmt] +alias = "format-apply" + [tasks.lint-apply] category = "Tools" description = "Run linters with changes" @@ -41,9 +44,13 @@ dependencies = [ "format-check", ] script = [ + "actionlint", "npm run lint:check", ] +[tasks.lint] +alias = "lint-check" + [tasks.test-ts] category = "Tools" description = 'Test typescripts' @@ -86,6 +93,7 @@ script = [ "dprint --version", # Returnes NON 0, why...? :< # "nixpkgs-fmt --version", + "actionlint --version", ] [tasks.check_no_git_diff] diff --git a/default.nix b/default.nix index 9d49e003..b5e607f2 100644 --- a/default.nix +++ b/default.nix @@ -7,5 +7,6 @@ pkgs.mkShell { pkgs.cargo-make pkgs.nil pkgs.nixpkgs-fmt + pkgs.actionlint ]; }