Deprecated, use npx -y awesome-lint 'path/to/file.md'
instead.
deprecated readme
This Action wraps awesome-lint
allowing easy linting of your awesome projects!
What I mean by versionless, is that this Action allows consumers to specify the version of the awesome-lint
package they desire.
Why do this? What are the downsides?
Pinning your Actions to a commit sha d007f09bd2de33809fb3c0e43f8461d092d38970
is preferred as it is considered more secure to pinning to release numbers v1.0.0
or branch names main
as the code cannot change without you explicitly opting-in.
This design allows people to pin to a commit sha of this Action with the freedom to update the version of awesome-lint
independently. This is not possible in an Action written in JavaScript, or with Docker build-time dependency installation.
In my opinion, an Action that wraps an existing tool for consumption in GitHub Actions should only provide that convenience. And that convenience shouldn't require them to constantly be updating their usage. It does make updating the version of awesome-lint
manual, but again, that is the more secure option to take.
Downsides?
npm install
is performed at time of use. The Action still requires to be built with Docker, so even if the npm install
was performed in the Dockerfile it wouldn't save the ~12 second npm install
time. If the Action was reused, it would need to npm install
on each use, even if the Docker image was cached. A small tradeoff if you ask me.
args
- Optional. These are the arguments to pass to theawesome-lint
CLI.
AWESOME_LINT_VERSION
- Optional. Theawesome-lint
package version you wish to use.
awesome-lint
CLI will automatically lint README.md
:
name: Lint Awesome List
on: [push]
jobs:
awesome-lint:
name: "lint: awesome-lint"
runs-on: ubuntu-latest
steps:
- name: "checkout repo"
uses: actions/checkout@v2.0.0
with:
fetch-depth: 0
- name: Test awesome-lint with custom file path
uses: jthegedus/github-action-awesome-lint@68fc989d5a01aa127ce502a59f72ebe4166386f1 # commit_sha of tag v0.1.0
Specify the file to lint:
name: Lint Awesome List
on: [push]
jobs:
awesome-lint:
name: "lint: awesome-lint"
runs-on: ubuntu-latest
steps:
- name: "checkout repo"
uses: actions/checkout@v2.0.0
with:
fetch-depth: 0
- name: Test awesome-lint with custom file path
uses: jthegedus/github-action-awesome-lint@68fc989d5a01aa127ce502a59f72ebe4166386f1 # commit_sha of tag v0.1.0
with:
args: "path/to/file.md
Specify the awesome-lint
package you wish to install from npm
:
name: Lint Awesome List
on: [push]
jobs:
awesome-lint:
name: "lint: awesome-lint"
runs-on: ubuntu-latest
steps:
- name: "checkout repo"
uses: actions/checkout@v2.0.0
with:
fetch-depth: 0
- name: Test custom awesome-lint version
uses: jthegedus/github-action-awesome-lint@68fc989d5a01aa127ce502a59f72ebe4166386f1 # commit_sha of tag v0.1.0
env:
AWESOME_LINT_VERSION: "0.11"
Combination of all custom values:
name: Lint Awesome List
on: [push]
jobs:
awesome-lint:
name: "lint: awesome-lint"
runs-on: ubuntu-latest
steps:
- name: "checkout repo"
uses: actions/checkout@v2.0.0
with:
fetch-depth: 0
- name: Test custom awesome-lint version
uses: jthegedus/github-action-awesome-lint@68fc989d5a01aa127ce502a59f72ebe4166386f1 # commit_sha of tag v0.1.0
env:
AWESOME_LINT_VERSION: "0.11"
with:
args: "path/to/file.md"
Contributions of any kind welcome, just follow the guidelines!
Thanks goes to these contributors!
After the below are complete we will cut a major semver release: v1.0.0
.
Tests:
- Expected failure examples
- Better GitHub Actions Annotations output - see https://developer.github.com/v3/checks/runs/#update-a-check-run
Run Shellcheck overentrypoint.sh
- Run hadolint (Dockerfile Linter) over
dockerfile
Functionality:
- Runtime check for new version of Action being used with announcement log in usage
- Improved logging (find out how GitHub Actions performs highlighting and determine nice visual pattern to follow)
Other:
- Blog post about installing deps at runtime
- GitHub Actions template