From 822a8962ae3a10400fc0dd0209c459c9aeeb1d09 Mon Sep 17 00:00:00 2001 From: "@zimeg" Date: Tue, 1 Jul 2025 20:26:26 -0700 Subject: [PATCH 1/6] feat: check spellings of words for typos --- action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.yml b/action.yml index 25a4290..33a3f9e 100644 --- a/action.yml +++ b/action.yml @@ -46,6 +46,8 @@ runs: script: | const script = require("./dist/index.js"); await script(context, core, github); + - name: Spelling + uses: crate-ci/typos@392b78fe18a52790c53f42456e46124f77346842 # v1.34.0 branding: icon: 'heart' color: 'red' From 5213432dca53531b4abdf1c90232cce440aebf67 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 1 Aug 2025 18:19:28 -0700 Subject: [PATCH 2/6] build: swap the package publishing action for tagged releases --- .github/workflows/publish.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fac80d6..164a2c9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,9 @@ name: Publish on: release: - types: [published, edited] + types: + - published + - edited jobs: build: @@ -19,8 +21,10 @@ jobs: run: npm ci - name: Build Action run: npm run build - - uses: JasonEtco/build-and-tag-action@dd5e4991048c325f6d85b4155e586fc211c644da # v2.0.1 + - name: Distribute the latest tagged release + id: tag + uses: teunmooij/github-versioned-release@3edf649c6e5e5e976d43f2584b15bdc8b4c8f0df # v1.2.1 + with: + template: javascript-action env: GITHUB_TOKEN: ${{ github.token }} - with: - tag_name: ${{ github.event.release.tag_name }} From 6e56feae6a96c0e9d1979e7f79e92e01b9d48d42 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 1 Aug 2025 18:23:19 -0700 Subject: [PATCH 3/6] feat: use a typos configuration file --- .github/workflows/publish.yml | 1 + .typos.toml | 5 +++++ action.yml | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 .typos.toml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 164a2c9..57493d7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,6 +25,7 @@ jobs: id: tag uses: teunmooij/github-versioned-release@3edf649c6e5e5e976d43f2584b15bdc8b4c8f0df # v1.2.1 with: + include: .typos.toml template: javascript-action env: GITHUB_TOKEN: ${{ github.token }} diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..2b93b1c --- /dev/null +++ b/.typos.toml @@ -0,0 +1,5 @@ +# https://github.com/crate-ci/typos +[files] +extend-exclude = [ + "biome.json" +] diff --git a/action.yml b/action.yml index 33a3f9e..5dcddd6 100644 --- a/action.yml +++ b/action.yml @@ -48,6 +48,8 @@ runs: await script(context, core, github); - name: Spelling uses: crate-ci/typos@392b78fe18a52790c53f42456e46124f77346842 # v1.34.0 + with: + config: .typos.toml branding: icon: 'heart' color: 'red' From c2a3c48604ec26ca4ef4f6a8064636e2875e1139 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 1 Aug 2025 18:23:32 -0700 Subject: [PATCH 4/6] style: double quote strings when possible --- README.md | 16 ++++++++-------- action.yml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 36fa151..04b9e99 100644 --- a/README.md +++ b/README.md @@ -47,42 +47,42 @@ Two important notes about the API tokens this action relies on: # The file extension to inspect as part of health score calculation. For example, 'js' # or 'go' These conditions are logically OR'ed together using -o (OR) in the find command. # This input is required. - extension: '' + extension: "" # A GitHub access token with permissions to write GitHub Checks. Recommended to set # this to `${{ secrets.GITHUB_TOKEN }}` in a workflow `job` that has `checks: write` # permissions. See the full `job` example at the beginning of this README. # This input is required. - github_token: '' + github_token: "" # Only parse the specified files and directories (recursively). Defaults to `.`. # E.g. "src" - include: '' + include: "" # Ignore the specified files and directories. Essentially a direct argument into # `find` `-not -path "{arg}"`. Defaults to contents of `.gitignore`. # E.g. "node_modules" - exclude: '' + exclude: "" # A CodeCov API access token with read permissions to the repo. This _cannot_ be # a CodeCov "Global Upload" token - it _must_ be a human user API access token. # Setting this will try to pull coverage information for the repo from CodeCov to # include in health score calculation; not setting it will exclude code coverage # from health score calculation. - codecov_token: '' + codecov_token: "" # Maximum number of times to try retrieving code coverage information from codecov. # Defaults to 10. - codecov_max_attempts: '' + codecov_max_attempts: "" # Number of milliseconds to wait when retrying retrieving code coverage information # from codecov. Defaults to 10000 (10 seconds). - codecov_retry_delay: '' + codecov_retry_delay: "" # If retrieving code coverage from CodeCov times out (according to the configuration # set up via the `codecov_max_attempts` and `codecov_retry_delay` inputs), should that # cause this action to error out. Defaults to false. - codecov_treat_timeout_as_error: '' + codecov_treat_timeout_as_error: "" ``` ## What is Slack's Health Score? diff --git a/action.yml b/action.yml index 5dcddd6..6928b11 100644 --- a/action.yml +++ b/action.yml @@ -1,11 +1,11 @@ -name: 'slack-health-score' -description: 'Report some code quality heuristics as defined by Slack Engineering' +name: "slack-health-score" +description: "Report some code quality heuristics as defined by Slack Engineering" inputs: extension: description: 'File extension of files to filter on to report health score on. E.g. "js" or "go"' required: true github_token: - description: 'A GitHub access token with permissions to write GitHub Checks. Recommended to set this to `secrets.GITHUB_TOKEN` in combination with using in a workflow `job` that has `checks: write` permissions.' + description: "A GitHub access token with permissions to write GitHub Checks. Recommended to set this to `secrets.GITHUB_TOKEN` in combination with using in a workflow `job` that has `checks: write` permissions." required: true include: description: 'Only parse the specified files and directories (recursively). Defaults to `.`. E.g. "src"' @@ -17,13 +17,13 @@ inputs: description: 'A CodeCov API access token with read permissions to the repo. This _cannot_ be a CodeCov "Global Upload" token - it _must_ be a human user API access token. Setting this will try to pull coverage information for the repo from CodeCov to include in health score calculation; not setting it will exclude code coverage from health score calculation.' required: false codecov_max_attempts: - description: 'Maximum number of times to try retrieving code coverage information from codecov. Defaults to 10.' + description: "Maximum number of times to try retrieving code coverage information from codecov. Defaults to 10." required: false codecov_retry_delay: - description: 'Number of milliseconds to wait when retrying retrieving code coverage information from codecov. Defaults to 10000 (10 seconds).' + description: "Number of milliseconds to wait when retrying retrieving code coverage information from codecov. Defaults to 10000 (10 seconds)." required: false codecov_treat_timeout_as_error: - description: 'If retrieving code coverage from CodeCov times out (according to the configuration set up via the `codecov_max_attempts` and `codecov_retry_delay` inputs), should that cause this action to error out. Defaults to false.' + description: "If retrieving code coverage from CodeCov times out (according to the configuration set up via the `codecov_max_attempts` and `codecov_retry_delay` inputs), should that cause this action to error out. Defaults to false." required: false # outputs: runs: @@ -51,5 +51,5 @@ runs: with: config: .typos.toml branding: - icon: 'heart' - color: 'red' + icon: "heart" + color: "red" From f49627107ccd95f3ac0ac5c7cea0143bb69e60ad Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 1 Aug 2025 18:26:22 -0700 Subject: [PATCH 5/6] fix: typo 'comment' --- test/helpers/helpers-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/helpers/helpers-test.js b/test/helpers/helpers-test.js index b3529cb..6d32984 100644 --- a/test/helpers/helpers-test.js +++ b/test/helpers/helpers-test.js @@ -105,7 +105,7 @@ describe('helpers', () => { path: 'path2', line_no: 15, comment: '// random FIXME comment', - commmentType: null, + commentType: null, }, ]), [ From be9558e93aa8f33fd0f160b93bbe71dbb3c1c6ec Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 1 Aug 2025 18:44:18 -0700 Subject: [PATCH 6/6] fix: esm inline --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 6928b11..3df5533 100644 --- a/action.yml +++ b/action.yml @@ -44,7 +44,7 @@ runs: INPUT_CODECOV_TREAT_TIMEOUT_AS_ERROR: ${{ inputs.codecov_treat_timeout_as_error }} with: script: | - const script = require("./dist/index.js"); + import script from "./dist/index.js"; await script(context, core, github); - name: Spelling uses: crate-ci/typos@392b78fe18a52790c53f42456e46124f77346842 # v1.34.0