Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
eslint-plugin-actions
Advanced tools
Readme
Lint JS inside GitHub Actions workflow
You'll first need to install ESLint 8 or greater:
$ npm i eslint --save-dev
$ yarn add -D eslint
Next, install eslint-plugin-actions
:
$ npm install eslint-plugin-actions --save-dev
$ yarn add -D eslint-plugin-actions
Extending the plugin:actions/recommended
config will enable the processor on all workflow .{yml,yaml}
files:
{
"extends": ["plugin:actions/recommended"]
}
Currently, only literal blocks (|
) are supported and it's recommended to use them:
# .github/workflows/ci.yml
jobs:
build:
steps:
- uses: actions/github-script@v2
with:
script: |
// .github/workflows/ci.yml/0_build/0.js
The autofixing (--fix
) is supported, but it's still experimental and whitespace handling of YAML is different from JS, so be sure to check the result.
Dotfiles are ignored by ESLint by default. To lint files inside .github
, you'll need to add !.github
to
.eslintignore
file or ignorePatterns
of your configuration file:
!/.github
Then, add actions
to the plugins section of your configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["actions"]
}
Use the processor
option in an overrides
entry to enable the plugin on workflow YAML files:
{
"overrides": [{
"files": [".github/workflows/*.{yml,yaml}"],
"processor": "actions/actions"
}]
}
Each script inside a workflow has a virtual filename appended to the YAML file's path. It has the format of [global index]_[job id]/[local index].js
(see the example above). overrides
glob patterns for these virtual filenames can customize configuration for scripts without affecting regular code. For more information on configuring processors, refer to the ESLint documentation:
{
"overrides": [{
"files": [".github/workflows/*.{yml,yaml}/*_build/*.js"],
"rules": {
"indent": ["error", 2, {"outerIIFEBody": 0}]
...
},
...
}]
}
The script will be enclosed in an IIFE async function, when processed by ESLint:
(async function(context, github, io, core) {
...
}());
Therefore, if indent
or indent-legacy
rule is used, the outerIIFEBody
option should be set to 0
(see above). Furthermore, rules affecting the beginning and the end of the file, such as unicode-bom
, eol-last
and no-multiple-empty-lines
, are ignored.
This plugin is heavily inspired by and adapted from eslint-plugin-markdown.
FAQs
Lint JS inside GitHub Actions workflow
The npm package eslint-plugin-actions receives a total of 275 weekly downloads. As such, eslint-plugin-actions popularity was classified as not popular.
We found that eslint-plugin-actions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.