Skip to content

feat: added github actions workflow #1

feat: added github actions workflow

feat: added github actions workflow #1

name: Dependency Vulnerability Scan
on:
push:
branches:
- '**' # All branches
jobs:
scan-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check for dependency changes
id: deps
run: |
git fetch origin ${{ github.event.before }}
# Check if go.mod or go.sum changed
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E 'go\.mod|go\.sum'; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Run VS Code Extension Vulnerability Scan
if: steps.deps.outputs.changed == 'true'
run: |
npx ts-node src/cli.ts --input go.mod --output report.json
- name: Upload Security Report
if: steps.deps.outputs.changed == 'true'
uses: actions/upload-artifact@v4
with:
name: security-report
path: report.json