-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add secretlint #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
af23e36
918c0b1
e150365
b136132
cd02058
66d893e
4d3cefb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,42 @@ | ||||||
| name: Secretlint | ||||||
| on: | ||||||
| push: | ||||||
| branches: | ||||||
| - main | ||||||
| pull_request: | ||||||
| permissions: | ||||||
| contents: read | ||||||
| jobs: | ||||||
| test: | ||||||
| name: "Secretlint" | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: 📥 Checkout repository | ||||||
| uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # main | ||||||
|
|
||||||
| - name: 🟢 Setup Node.js | ||||||
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # main | ||||||
| with: | ||||||
| node-version-file: ".tool-versions" | ||||||
| cache: "npm" | ||||||
|
|
||||||
| - name: 🗄 Cache node_modules | ||||||
| id: cache-node_modules | ||||||
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # main | ||||||
| with: | ||||||
| path: "**/node_modules" | ||||||
| key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | ||||||
|
|
||||||
| - name: 🗄 Cache .eslintcache | ||||||
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # main | ||||||
| with: | ||||||
| path: .eslintcache | ||||||
| key: eslintcache-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | ||||||
|
|
||||||
| - name: 🔍 Install dependencies | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we don't even need to install dependencies. We could instead just install secretlint via |
||||||
| if: steps.cache-node_modules.outputs.cache-hit != 'true' | ||||||
| run: | | ||||||
| npm ci --ignore-scripts --prefer-offline --no-audit | ||||||
|
Comment on lines
+14
to
+39
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I duplicated this from the existing test workflow. Not sure if we should integrate the Secretlint workflow into the existing workflow? |
||||||
|
|
||||||
| - name: Lint with Secretlint | ||||||
| run: npx secretlint --format github "**/*" | ||||||
|
||||||
| run: npx secretlint --format github "**/*" | |
| run: npm exec -- secretlint --format github "**/*" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "rules": [ | ||
| { | ||
| "id": "@secretlint/secretlint-rule-preset-recommend" | ||
| } | ||
| ] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow caches
.eslintcache, but it never runs ESLint. This adds unnecessary cache restore/save overhead and can be removed (or replaced with a Secretlint-specific cache if needed).