This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
devicehub-teal/.github/workflows/eslint.yml

56 lines
1.7 KiB
YAML
Raw Permalink Normal View History

2022-04-20 09:54:58 +00:00
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# ESLint is a tool for identifying and reporting on patterns
# found in ECMAScript/JavaScript code.
# More details at https://github.com/eslint/eslint
# and https://eslint.org
name: ESLint
on:
push:
branches: [master, testing]
2022-04-25 09:15:33 +00:00
pull_request_target:
2022-04-20 09:54:58 +00:00
branches: [master, testing]
jobs:
2022-07-11 11:46:52 +00:00
build:
2022-04-20 09:54:58 +00:00
runs-on: ubuntu-latest
steps:
2022-07-11 11:46:52 +00:00
- uses: actions/checkout@v3
2022-04-20 09:54:58 +00:00
- uses: actions/setup-node@v1
with:
node-version: '16'
- name: Install dependencies
run: npm install
2022-04-20 10:04:18 +00:00
- name: Run linters
uses: wearerequired/lint-action@v1
with:
eslint: true
prettier: false
commit_message: "Fix code style issues with ${linter}"
auto_fix: true
commit: true
github_token: "${{ secrets.GITHUB_TOKEN }}"
git_name: "Lint Action"
2022-04-20 09:54:58 +00:00
- name: Save Code Linting Report JSON
# npm script for ESLint
# eslint --output-file eslint_report.json --format json src
# See https://eslint.org/docs/user-guide/command-line-interface#options
run: npm run lint:report
# Continue to the next step even if this fails
continue-on-error: true
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@1.2.0
with:
2022-04-25 09:15:33 +00:00
repo-token: ${{ secrets.GITHUB_TOKEN }}
2022-04-20 09:54:58 +00:00
report-json: "eslint_report.json"
2022-04-25 09:15:33 +00:00
only-pr-files: true
2022-04-20 09:54:58 +00:00
- name: Upload ESLint report
uses: actions/upload-artifact@v2
with:
name: eslint_report.json
path: eslint_report.json