Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add lint and security workflows #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint

on: push

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 23

- name: Install Node.js dependencies
run: |
npm install --save-dev --save-exact prettier

- name: Run linters
uses: wearerequired/lint-action@v1
with:
github_token: ${{ secrets.github_token }}
# Enable linters
prettier: true
56 changes: 56 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: security

on:
push:
pull_request:
schedule: # run weekly, every Thursday 01:00
- cron: '0 1 * * 4'

permissions: {}

jobs:
build:
permissions:
contents: read
runs-on: ${{ matrix.distribution }}-${{ matrix.version }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
include:
- distribution: ubuntu
version: '24.04'
experimental: true
node: 23
- distribution: ubuntu
version: '24.04'
experimental: true
node: 20

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.node }}
- name: Clean nodejs environment
run: |
set -x
dpkg -l | grep nodejs || true
ls -l /opt/hostedtoolcache/ || true
whereis node || true
whereis npm || true
ls -l /usr/local/bin/node* || true
node --version || true
npm --version || true
sudo rm -Rf /opt/hostedtoolcache/node/1[68]*
node --version || true
- name: npm
run: |
set -x
npm outdated || true
npm audit || true
yarn audit || true
if: ${{ always() }}
continue-on-error: true