-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Integrate typos tool into CI #6967
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
Changes from all commits
a21cb2a
d642eda
8aa427a
bffb869
567794f
2e1a81e
a2dfb84
50e3131
fd171f4
e478773
9e5da1e
ab1d1a6
d82bfa9
d45f2e4
383e5bc
b85b0e4
7fec732
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,30 @@ | ||
| name: 💾 Memoize Functions | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - dev | ||
| paths: | ||
| - 'pkg/js/libs/**' | ||
| - 'cmd/memogen/**' | ||
| workflow_dispatch: {} | ||
|
|
||
| jobs: | ||
| memogen: | ||
| if: ${{ !endsWith(github.actor, '[bot]') }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - uses: projectdiscovery/actions/setup/go@3bde399a61ae14f8dfe72f4aeffd77571204a0e1 # v1 | ||
| - uses: projectdiscovery/actions/setup/git@e28e4a08cde4e3e97c8f7c2e8b04f6a3c9a74b2d # v1 | ||
| - run: make memogen | ||
| - run: git status -s | wc -l | xargs -I {} echo CHANGES={} >> $GITHUB_OUTPUT | ||
| id: status | ||
| - uses: projectdiscovery/actions/commit@a4b5c6d7e8f9a4b5c6d7e8f9a4b5c6d7e8f9a4b5 # v1 | ||
| if: steps.status.outputs.CHANGES > 0 | ||
| with: | ||
| files: | | ||
| pkg/js/libs/ | ||
| message: 'chore(js): update memoized functions 🤖' | ||
| - run: git push origin ${{ github.ref }} | ||
| if: steps.status.outputs.CHANGES > 0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # typos configuration | ||
| # See https://github.com/crate-ci/typos/blob/master/docs/reference.md | ||
|
|
||
| [default] | ||
| # extend-words = {} | ||
| # extend-ignore-words-re = [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: Typos Check | ||
|
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. 🟡 Unpinned pip package version allows supply chain drift — The command 'pip install typos' installs the latest version without pinning to a specific version or hash. This allows automatic updates that could introduce breaking changes or malicious code if the package is compromised. Suggested FixHowever, switching to the official GitHub Action (as recommended above) is the better solution as it uses pinned commit SHAs. Pin typos package version with hash verification or switch to official GitHub Action |
||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| typos-check: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Check spelling with typos | ||
| uses: crate-ci/typos@b67cb3f3f8b7c0f27568b1e19b8f62f6d8a6b1e4 # v1.28.3 | ||
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.
🟡 Suboptimal typos installation method in CI workflow — The workflow installs typos via pip (Python package manager) instead of using the official GitHub Action or pre-built binaries. While the PyPI package is legitimate, this approach is less secure and less efficient than the recommended methods.
Suggested Fix
Alternatively, install the pre-built binary directly:
Replace pip install typos with official crate-ci/typos GitHub Action