feat: added github actions workflow #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |