feat(action): Add regular github action for audit security vulnerability

This commit is contained in:
Félix MARQUET
2025-12-17 08:53:44 +00:00
parent 30d9c3d473
commit 4fd7a797c5
3 changed files with 54 additions and 13 deletions

View File

@@ -0,0 +1,12 @@
{
"name": "Node.js 24",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "lts",
"nvmVersion": "latest"
},
"ghcr.io/devcontainers/features/git-lfs:1": {}
}
}

42
.github/workflows/audit.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Security Audit
on:
push:
branches: [main, dev]
pull_request:
branches:
- '**'
schedule:
- cron: '0 8 * * *'
workflow_dispatch:
jobs:
audit:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install dependencies
run: npm install
- name: Run security audit
id: audit
run: npm audit --audit-level moderate
continue-on-error: true
- name: Create issue on failure
if: steps.audit.outcome == 'failure'
uses: actions/github-script@v8
with:
script: |
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Security Audit Failed',
body: 'The daily security audit has failed. Please check the workflow run for details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
labels: ['security', 'audit']
});

13
package-lock.json generated
View File

@@ -1819,19 +1819,6 @@
"url": "https://opencollective.com/eslint"
}
},
"node_modules/eslint/node_modules/@eslint/js": {
"version": "9.39.1",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.1.tgz",
"integrity": "sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"url": "https://eslint.org/donate"
}
},
"node_modules/espree": {
"version": "10.4.0",
"resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",