Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Publish

on:
release:
types: [published, edited]
types:
- published
- edited

jobs:
build:
Expand All @@ -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 }}
5 changes: 5 additions & 0 deletions .typos.toml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📣 note: I'm concerned that using this file across multiple projects could block downstream changes if unexpected words appear that we should exclude.

thought: Changing this to be a nonblocking step or using a .typos.toml file from the project if found are perhaps ideas. I'm kind of wanting to start with this though...

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://github.com/crate-ci/typos
[files]
extend-exclude = [
"biome.json"
]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
22 changes: 13 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
@@ -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"'
Expand All @@ -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:
Expand All @@ -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"
2 changes: 1 addition & 1 deletion test/helpers/helpers-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('helpers', () => {
path: 'path2',
line_no: 15,
comment: '// random FIXME comment',
commmentType: null,
commentType: null,
},
]),
[
Expand Down
Loading