diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fac80d6..57493d7 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,11 @@ 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: + include: .typos.toml + template: javascript-action env: GITHUB_TOKEN: ${{ github.token }} - with: - tag_name: ${{ github.event.release.tag_name }} 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/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 25a4290..3df5533 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: @@ -44,8 +44,12 @@ 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 + with: + config: .typos.toml branding: - icon: 'heart' - color: 'red' + icon: "heart" + color: "red" 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, }, ]), [