Skip to content

Conversation

@OmarBERRABEH
Copy link

This change integrates Snyk into the CI/CD pipeline to perform security vulnerability scanning on all projects.

Key changes include:

  • Added Snyk CLI installation (using pnpm) and scan steps to the .github/workflows/node.js.yml GitHub Actions workflow.
  • Configured Snyk to output results in SARIF format (snyk.sarif).
  • Updated README.md to include:
    • Information about the Snyk integration.
    • Instructions for configuring the SNYK_TOKEN GitHub secret.
    • Guidance on running Snyk scans locally for development and testing.

How to test:

  1. After these changes are pushed, a Pull Request should be created.
  2. Verify that the "Node.js CI" GitHub Action associated with the PR runs successfully.
  3. In the GitHub Action logs for the "Run Snyk scan" step:
    • Confirm that the Snyk scan executes without errors.
    • Check for any reported vulnerabilities.
  4. (Optional) If a step to upload SARIF files as build artifacts is added to the workflow, verify that snyk.sarif is available for download.
  5. Review the changes in README.md to ensure the documentation regarding Snyk integration, configuration, and local testing is clear, accurate, and complete.

Pull Request Template

✨ Title

  • [FEATURE]: for a new feature
  • [EVOL]: for an enhancement
  • [FIX]: for a bug fix
  • [REFACTOR]: for a refactor

📄 Description

Please explain in detail what this PR does, why it is needed, and how it addresses a specific problem. Include any relevant context and background information.

Checklist

  • I have read and followed the Contribution Guide.
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings or errors.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

🔗 Contextual Links (optional)

Add any relevant links to tracking tickets, previous discussions, or other resources.

📸 Visuals (optional)

If possible, include images or videos that show the result of your changes.

🔍 Reviewers

Please assign at least one reviewer for this PR. The PR cannot be merged until it is approved by the reviewer(s).

This change integrates Snyk into the CI/CD pipeline to perform security vulnerability scanning on all projects.

Key changes include:
- Added Snyk CLI installation (using pnpm) and scan steps to the .github/workflows/node.js.yml GitHub Actions workflow.
- Configured Snyk to output results in SARIF format (snyk.sarif).
- Updated README.md to include:
  - Information about the Snyk integration.
  - Instructions for configuring the SNYK_TOKEN GitHub secret.
  - Guidance on running Snyk scans locally for development and testing.

How to test:
1. After these changes are pushed, a Pull Request should be created.
2. Verify that the "Node.js CI" GitHub Action associated with the PR runs successfully.
3. In the GitHub Action logs for the "Run Snyk scan" step:
    - Confirm that the Snyk scan executes without errors.
    - Check for any reported vulnerabilities.
4. (Optional) If a step to upload SARIF files as build artifacts is added to the workflow, verify that snyk.sarif is available for download.
5. Review the changes in README.md to ensure the documentation regarding Snyk integration, configuration, and local testing is clear, accurate, and complete.
Addresses the ERR_PNPM_NO_GLOBAL_BIN_DIR error during Snyk CLI installation in the GitHub Actions workflow.

This commit adds a 'pnpm setup' step before installing global pnpm packages. This ensures that the pnpm global binary directory is correctly configured and added to the PATH, allowing global installations like 'pnpm add -g snyk' to succeed.

How to test:
1. Push these changes to the Pull Request.
2. Verify that the "Node.js CI" GitHub Action associated with the PR runs successfully.
3. Specifically, check that the "Install Snyk CLI" step (which runs 'pnpm add -g snyk') completes without the ERR_PNPM_NO_GLOBAL_BIN_DIR error.
4. Confirm that the subsequent "Run Snyk scan" step also executes as expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant