Skip to content

Eslint9 private test #122

Eslint9 private test

Eslint9 private test #122

Workflow file for this run

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
name: E2E integration
on:
push:
branches: [main]
pull_request_target:
branches: [main, release/vNext]
env:
PROJECT: nodejs # The name of the project you want to clone. It must be on github
REPOSITORY: node # The repository name
FOLDER_TO_SCAN: lib # The folder under which the source code you have is contained. Relative to the repository
TS_CONFIG_PATH: tsconfig.json # The tsconfig.json path relative to the repository
jobs:
build:
name: E2E run with sarif
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Setup Node.js environment
uses: actions/[email protected]
- uses: actions/checkout@v2
with:
repository: ${{env.PROJECT}}/${{env.REPOSITORY}}
path: ${{env.PROJECT}}
clean: true
- uses: actions/checkout@v2
with:
path: eslint-plugin-sdl
clean: true
# store them inside a seperate folder for performance in case of multiple projects.
# Trying to install eslint on a project with an existing package.json will install all of the package.json packages as well
- name: Create eslint directory
run: |
mkdir eslint
working-directory: ${{github.workspace}}
continue-on-error: true
- name: Install eslint for discord library and eslint-plugin-dependencies
run: |
npm i eslint
npm i eslint-plugin-security
npm i eslint-plugin-react
npm i eslint-plugin-node
npm i typescript
npm i @microsoft/eslint-formatter-sarif
working-directory: eslint
- name: Link the eslint-plugin-sdl
run: |
sudo npm link ../eslint-plugin-sdl
working-directory: eslint
if: runner.os == 'Linux'
- name: Link the eslint-plugin-sdl
run: |
npm link ../eslint-plugin-sdl
working-directory: eslint
if: runner.os == 'Windows'
- name: Run eslint
run: npx eslint
-c node_modules/@microsoft/eslint-plugin-sdl/config/required.js
../${{env.PROJECT}}/${{env.FOLDER_TO_SCAN}}/
--ext .js
--parser-options=project:../${{env.PROJECT}}/${{env.TS_CONFIG_PATH}}
--no-eslintrc
-f @microsoft/eslint-formatter-sarif
-o ../${{env.PROJECT}}/eslint-result-${{ matrix.os }}-${{github.run_id}}.sarif
working-directory: eslint
continue-on-error: true
- name: Upload eslint results as artifact
uses: actions/upload-artifact@v4
with:
name: eslint-result
path: ${{env.PROJECT}}/eslint-result-${{ matrix.os }}-${{github.run_id}}.sarif
if-no-files-found: error