diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..36852de --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,23 @@ +name: Lint +on: + push: + pull_request: + +jobs: + run-secretlint: + name: "Secretlint only on changed files" + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3.5.2 + - name: setup get-diff-action + uses: technote-space/get-diff-action@v6.1.2 + - name: setup Node.js + uses: actions/setup-node@v3.6.0 + with: + node-version: 16 + - name: npm install + run: npm install + - name: lint with Secretlint + run: npx --no-install secretlint ${{ env.GIT_DIFF_FILTERED }} + if: env.GIT_DIFF && !env.MATCHED_FILES -- knotmirror 0.0.1 From 4be60d10295b4e6f2573b31cbaf9cc454cf30e4d Mon Sep 17 00:00:00 2001 From: ucpr Date: Sat, 3 Jun 2023 07:19:31 +0900 Subject: [PATCH 2/2] run on docker --- .github/workflows/lint.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 36852de..1e76a9a 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -12,12 +12,12 @@ jobs: uses: actions/checkout@v3.5.2 - name: setup get-diff-action uses: technote-space/get-diff-action@v6.1.2 - - name: setup Node.js - uses: actions/setup-node@v3.6.0 + - name: Run secretlint command on docker + uses: addnab/docker-run-action@v3 with: - node-version: 16 - - name: npm install - run: npm install - - name: lint with Secretlint - run: npx --no-install secretlint ${{ env.GIT_DIFF_FILTERED }} - if: env.GIT_DIFF && !env.MATCHED_FILES + image: secretlint/secretlint:v5.1.1 + options: > + -v ${{ github.workspace }}:${{ github.workspace }} + -w=${{ github.workspace }} + --rm + run: secretlint ${{ env.GIT_DIFF_FILTERED }} # run only on changed files