Skip to content

fix: lint

fix: lint #308

name: SNX-API CI
on:
push:
pull_request:
branches: [main, dev]
jobs:
audit:
# run only on main/dev branch and pull requests
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
container:
image: synthetixio/docker-sec-tools:20.12-alpine
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- name: Audit dependencies
run: audit-ci --critical --report-type full
- name: Lockfile lint
run: lockfile-lint -p yarn.lock --type yarn --allowed-hosts yarn --empty-hostname false --validate-package-names --validate-https
build:
needs: audit
# run only on audit success or audit skipped
if: always() && (needs.audit.result == 'success' || needs.audit.result == 'skipped')
runs-on: ubuntu-latest
container:
image: synthetixio/docker-node:20.12-alpine
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- name: Set yarn cache directory
run: yarn config set cache-folder .yarn-cache
continue-on-error: true
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: |
.yarn-cache
node_modules
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-v1-
continue-on-error: true
- name: Install dependencies
run: yarn --frozen-lockfile --prefer-offline --no-audit