Regenerate all MDC rules with fresh Exa data and December 2025 best practices

- Refreshed all 241 library rules with current best practices
- Updated Exa search results for all libraries with 2025 content
- Fixed --regenerate-all flag logic to properly process all libraries
- Removed duplicate astro entry in rules.json (merged tags)
- Added missing docker.mdc and vim.mdc files
- All rules now include modern patterns and anti-patterns
- Updated with framework-specific recommendations for 2025

Technical improvements:
- Fixed retry_failed_only logic in generate_mdc_files.py
- Improved progress tracking for regeneration scenarios
- Ensured proper handling of --refresh-exa flag
This commit is contained in:
sanjeed5
2025-12-17 22:40:28 +05:30
parent 331fb6ffac
commit 8fbf269085
244 changed files with 66701 additions and 52708 deletions
+387 -259
View File
@@ -1,261 +1,389 @@
---
description: This rule provides comprehensive guidelines for GitHub Actions development, covering best practices, coding standards, performance, security, and testing. It aims to ensure efficient, reliable, secure, and maintainable workflows.
globs: .github/workflows/*.yml
description: This guide provides definitive, opinionated best practices for writing robust, secure, and performant GitHub Actions workflows. Follow these rules to build maintainable CI/CD pipelines.
globs: **/*
---
# GitHub Actions Best Practices and Coding Standards
This guide provides comprehensive guidelines for developing efficient, reliable, secure, and maintainable GitHub Actions workflows. It covers various aspects of GitHub Actions development, including code organization, common patterns, performance considerations, security best practices, testing approaches, and tooling.
## 1. Code Organization and Structure
### 1.1 Directory Structure Best Practices
- **Workflows Directory:** Store all workflow files in the `.github/workflows` directory. This is the standard location recognized by GitHub.
- **Reusable Actions Directory (Optional):** If you create custom reusable actions, consider storing them in a dedicated directory like `actions/` within your repository.
- **Scripts Directory (Optional):** For complex workflows, you might have supporting scripts (e.g., shell scripts, Python scripts). Store these in a `scripts/` directory.
- **Example Directory Structure:**
.github/
└── workflows/
├── main.yml
├── deploy.yml
└── release.yml
actions/
├── my-custom-action/
│ ├── action.yml
│ └── index.js
scripts/
├── cleanup.sh
└── build.py
### 1.2 File Naming Conventions
- **Workflow Files:** Use descriptive and consistent names for workflow files (e.g., `deploy-staging.yml`, `code-analysis.yml`). Avoid generic names like `main.yml` if possible, especially in repositories with multiple workflows.
- **Action Files:** Name action files `action.yml` or `action.yaml` to clearly indicate their purpose.
- **Script Files:** Use appropriate extensions for scripts (e.g., `.sh` for shell scripts, `.py` for Python scripts).
### 1.3 Module Organization
- **Reusable Workflows:** Break down complex workflows into smaller, reusable workflows using the `uses:` syntax. This promotes modularity, reduces duplication, and improves maintainability.
- **Composite Actions:** For reusable steps within a workflow, consider creating composite actions. These group multiple steps into a single action.
- **Modular Scripts:** If you're using scripts, organize them into modules or functions for better readability and reusability.
### 1.4 Component Architecture
- **Workflow as a Component:** Treat each workflow as a self-contained component responsible for a specific task (e.g., building, testing, deploying).
- **Separation of Concerns:** Separate concerns within a workflow. For example, use different jobs for building, testing, and deploying.
- **Inputs and Outputs:** Define clear inputs and outputs for reusable workflows and composite actions to improve their composability.
### 1.5 Code Splitting Strategies
- **Job Splitting:** Divide a workflow into multiple jobs that run in parallel to reduce overall execution time.
- **Step Splitting:** Break down long-running steps into smaller, more manageable steps.
- **Conditional Execution:** Use `if:` conditions to conditionally execute jobs or steps based on specific criteria (e.g., branch name, file changes).
## 2. Common Patterns and Anti-patterns
### 2.1 Design Patterns Specific to GitHub Actions
- **Fan-out/Fan-in:** Use matrix builds to parallelize testing across different environments, then aggregate the results in a subsequent job.
- **Workflow Orchestration:** Use reusable workflows to orchestrate complex processes involving multiple steps and dependencies.
- **Event-Driven Workflows:** Trigger workflows based on specific GitHub events (e.g., push, pull request, issue creation) to automate tasks.
- **Policy Enforcement:** Implement workflows that enforce coding standards, security policies, or other organizational guidelines.
### 2.2 Recommended Approaches for Common Tasks
- **Dependency Caching:** Use the `actions/cache` action to cache dependencies (e.g., npm packages, Maven artifacts) to speed up subsequent workflow runs.
- **Secret Management:** Store sensitive information (e.g., API keys, passwords) as GitHub Secrets and access them in your workflows using the `${{ secrets.SECRET_NAME }}` syntax. Never hardcode secrets in your workflow files.
- **Artifact Storage:** Use the `actions/upload-artifact` and `actions/download-artifact` actions to store and retrieve build artifacts (e.g., compiled binaries, test reports).
- **Environment Variables:** Use environment variables to configure workflows and steps. Set environment variables at the workflow, job, or step level.
- **Workflow Status Badges:** Add workflow status badges to your repository's README file to provide a visual indication of the workflow's health.
### 2.3 Anti-patterns and Code Smells to Avoid
- **Hardcoding Secrets:** Never hardcode secrets directly in your workflow files. Use GitHub Secrets instead.
- **Ignoring Errors:** Don't ignore errors or warnings in your workflows. Implement proper error handling to ensure workflows fail gracefully.
- **Overly Complex Workflows:** Avoid creating overly complex workflows that are difficult to understand and maintain. Break them down into smaller, reusable workflows.
- **Lack of Testing:** Don't skip testing your workflows. Implement unit tests, integration tests, and end-to-end tests to ensure they function correctly.
- **Unnecessary Dependencies:** Avoid including unnecessary dependencies in your workflows. This can increase build times and introduce security vulnerabilities.
- **Directly Modifying `GITHUB_PATH` or `GITHUB_ENV`:** While these environment variables exist, using the recommended step outputs is preferred for cleaner, more robust interaction with other steps.
### 2.4 State Management Best Practices
- **Artifacts:** Use artifacts for persisting files between jobs. Upload at the end of one job, download at the start of another.
- **Environment Variables:** Define environment variables at the workflow or job level to pass configuration settings between steps.
- **Outputs:** Use step outputs to pass data between steps within a job.
- **GitHub API:** Use the GitHub API to store and retrieve data related to your workflows (e.g., workflow run status, deployment information).
- **External Databases:** For more complex state management requirements, consider using an external database.
### 2.5 Error Handling Patterns
- **`if: always()`:** Ensures a step runs even if a previous step failed, useful for cleanup or notification tasks. `if: always()` should be used with caution, as it can mask underlying issues.
- **`continue-on-error: true`:** Allows a job to continue even if a step fails. This is useful for non-critical steps or when you want to collect information about multiple failures before failing the workflow.
- **`try...catch...finally` (within Scripts):** Use `try...catch...finally` blocks in your scripts to handle exceptions and ensure proper cleanup.
- **Notifications:** Send notifications (e.g., email, Slack) when workflows fail or succeed to keep stakeholders informed.
- **Workflow Retries:** Consider using the `retry:` keyword to automatically retry failed jobs.
## 3. Performance Considerations
### 3.1 Optimization Techniques
- **Caching:** Use the `actions/cache` action aggressively to cache dependencies and intermediate build artifacts.
- **Concurrency:** Use concurrency to prevent multiple workflows from running at the same time.
- **Parallel Execution:** Run jobs in parallel to reduce overall execution time.
- **Optimized Images:** Optimize images before uploading them to your repository to reduce their size.
- **Minify Code:** Minify JavaScript and CSS files to reduce their size.
### 3.2 Memory Management
- **Resource Limits:** Be aware of the resource limits imposed by GitHub Actions runners. Monitor memory and CPU usage to prevent workflows from exceeding these limits.
- **Garbage Collection:** Ensure that your scripts and actions properly manage memory and avoid memory leaks.
- **Large Datasets:** If you're processing large datasets, consider using streaming techniques or splitting the data into smaller chunks.
### 3.3 Rendering Optimization
- N/A - Not typically relevant for GitHub Actions workflows themselves, but may be applicable to applications built and deployed by workflows.
### 3.4 Bundle Size Optimization
- N/A - Not typically relevant for GitHub Actions workflows themselves, but may be applicable to applications built and deployed by workflows.
### 3.5 Lazy Loading Strategies
- N/A - Not typically relevant for GitHub Actions workflows themselves, but may be applicable to applications built and deployed by workflows.
## 4. Security Best Practices
### 4.1 Common Vulnerabilities and How to Prevent Them
- **Code Injection:** Prevent code injection by validating all inputs and sanitizing data before using it in scripts or commands.
- **Secret Exposure:** Avoid exposing secrets in logs or error messages. Mask secrets using the `::add-mask::` command.
- **Third-Party Actions:** Carefully vet third-party actions before using them in your workflows. Pin actions to specific versions or commits to prevent unexpected changes.
- **Privilege Escalation:** Run workflows with the least privileges necessary to perform their tasks.
- **Workflow Command Injection:** Be cautious when dynamically constructing commands. If possible, use parameters or environment variables instead of concatenating strings.
### 4.2 Input Validation
- **Validate Inputs:** Validate all inputs to your workflows and actions to prevent malicious data from being processed.
- **Data Sanitization:** Sanitize data before using it in scripts or commands to prevent code injection vulnerabilities.
- **Regular Expressions:** Use regular expressions to validate the format of inputs.
### 4.3 Authentication and Authorization Patterns
- **GitHub Tokens:** Use GitHub tokens to authenticate with the GitHub API. Grant tokens the minimum necessary permissions.
- **Service Accounts:** Use service accounts to authenticate with external services. Store service account credentials as GitHub Secrets.
- **Role-Based Access Control (RBAC):** Implement RBAC to control access to your workflows and actions.
### 4.4 Data Protection Strategies
- **Encryption:** Encrypt sensitive data at rest and in transit.
- **Data Masking:** Mask sensitive data in logs and error messages.
- **Data Retention:** Establish a data retention policy to ensure that sensitive data is not stored indefinitely.
### 4.5 Secure API Communication
- **HTTPS:** Use HTTPS for all API communication.
- **TLS:** Use TLS encryption to protect data in transit.
- **API Keys:** Protect API keys and other credentials. Store them as GitHub Secrets and use them securely in your workflows.
- **Rate Limiting:** Implement rate limiting to prevent abuse of your APIs.
## 5. Testing Approaches
### 5.1 Unit Testing Strategies
- **Test Reusable Actions:** Unit test your custom reusable actions to ensure they function correctly.
- **Test Scripts:** Unit test your scripts to ensure they handle different inputs and edge cases correctly.
- **Mock Dependencies:** Use mocking to isolate units of code and test them in isolation.
### 5.2 Integration Testing
- **Test Workflow Integration:** Integrate test your workflows to ensure that all components work together correctly.
- **Test API Integrations:** Test your integrations with external APIs to ensure they function correctly.
- **Test Database Integrations:** Test your integrations with databases to ensure data is read and written correctly.
### 5.3 End-to-end Testing
- **Full Workflow Tests:** Run end-to-end tests to verify that your workflows function correctly from start to finish.
- **Simulate Real-World Scenarios:** Simulate real-world scenarios to ensure that your workflows can handle different situations.
### 5.4 Test Organization
- **Dedicated Test Directory:** Create a dedicated `tests/` directory for your tests.
- **Test Naming Conventions:** Follow consistent naming conventions for your test files and functions.
- **Test Suites:** Organize your tests into test suites based on functionality or component.
### 5.5 Mocking and Stubbing
- **Mock External Services:** Mock external services to isolate your tests from external dependencies.
- **Stub Functions:** Stub functions to control the behavior of dependencies during testing.
- **Mock GitHub API:** Mock the GitHub API to test your workflows without making real API calls.
## 6. Common Pitfalls and Gotchas
### 6.1 Frequent Mistakes Developers Make
- **Incorrect Syntax:** YAML syntax can be tricky. Use a linter or validator to catch syntax errors.
- **Incorrect Indentation:** Indentation is crucial in YAML. Use consistent indentation throughout your workflow files.
- **Missing Permissions:** Grant workflows the necessary permissions to access resources (e.g., repository contents, secrets).
- **Typos in Secrets:** Double-check the names of your secrets to avoid typos.
- **Not Pinning Action Versions:** Always pin actions to specific versions or commits to prevent unexpected changes.
### 6.2 Edge Cases to Be Aware Of
- **Rate Limits:** Be aware of GitHub API rate limits. Implement retry logic to handle rate limit errors.
- **Concurrent Workflow Runs:** Handle concurrent workflow runs gracefully to avoid conflicts.
- **Network Issues:** Implement error handling to handle network issues and transient errors.
- **Large File Sizes:** Be aware of the maximum file sizes supported by GitHub Actions.
### 6.3 Version-Specific Issues
- **Action Compatibility:** Ensure that your actions are compatible with the version of GitHub Actions you are using.
- **Runner Images:** Be aware of the changes in runner images and update your workflows accordingly.
### 6.4 Compatibility Concerns
- **Cross-Platform Compatibility:** Ensure that your workflows are compatible with different operating systems (e.g., Linux, Windows, macOS).
- **Browser Compatibility:** If your workflows involve web applications, test them in different browsers.
### 6.5 Debugging Strategies
- **Workflow Logs:** Examine workflow logs to identify errors and warnings.
- **Debugging Actions:** Use debugging actions to inspect the state of your workflows.
- **Step-by-Step Debugging:** Insert `echo` statements or debugging actions to trace the execution of your workflows step by step.
- **Local Testing:** Use tools like `act` to test your workflows locally before pushing them to GitHub.
## 7. Tooling and Environment
### 7.1 Recommended Development Tools
- **VS Code with GitHub Actions Extension:** Use VS Code with the GitHub Actions extension for syntax highlighting, code completion, and validation.
- **GitHub CLI:** Use the GitHub CLI to interact with the GitHub API from your workflows.
- **`act`:** Use `act` to test your workflows locally.
- **YAML Linter:** Use a YAML linter to catch syntax errors in your workflow files.
### 7.2 Build Configuration
- **`.github/workflows/`:** Place all workflow files in this directory.
- **`action.yml`:** For reusable actions, define their metadata in this file.
### 7.3 Linting and Formatting
- **YAML Lint:** Use a YAML linting tool to enforce consistent formatting and catch syntax errors.
- **Shellcheck:** Use Shellcheck to lint your shell scripts.
- **Prettier:** Use Prettier to format your JavaScript and CSS files.
### 7.4 Deployment Best Practices
- **Environment Variables:** Use environment variables to configure your deployments.
- **Deployment Strategies:** Use appropriate deployment strategies (e.g., blue/green deployment, canary deployment) to minimize downtime.
- **Rollback Strategies:** Implement rollback strategies to revert to a previous version if a deployment fails.
### 7.5 CI/CD Integration
- **Continuous Integration (CI):** Run automated tests on every commit to ensure code quality.
- **Continuous Delivery (CD):** Automate the deployment process to deliver new features and bug fixes to users quickly.
- **Automated Releases:** Automate the release process to create and publish releases automatically.
## Conclusion
By following these best practices and coding standards, you can create efficient, reliable, secure, and maintainable GitHub Actions workflows. Remember to adapt these guidelines to your specific needs and context. Continuously review and improve your workflows to ensure they meet your evolving requirements.
# github-actions Best Practices
GitHub Actions is the backbone of modern CI/CD. Adhering to these best practices ensures your workflows are efficient, secure, and maintainable. This guide is your definitive reference for building high-quality pipelines.
## 1. Workflow Design & Code Organization
Structure your workflows for clarity, reusability, and efficiency.
### 1.1 Use Reusable Workflows and Composite Actions
Avoid duplication. Abstract common sequences into reusable workflows or composite actions.
**❌ BAD: Duplicated Steps**
```yaml
# .github/workflows/build-frontend.yml
jobs:
build:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: npm run build
# .github/workflows/build-backend.yml
jobs:
build:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4 # Duplicated setup
with: { node-version: '20' }
- run: npm ci # Duplicated install
- run: npm run build:backend # Different build step
```
**✅ GOOD: Reusable Workflow**
```yaml
# .github/workflows/reusable-build.yml
on:
workflow_call:
inputs:
build-script: { required: true, type: string }
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: ${{ inputs.build-script }}
# .github/workflows/frontend.yml
jobs:
build:
uses: ./.github/workflows/reusable-build.yml
with: { build-script: 'npm run build:frontend' }
# .github/workflows/backend.yml
jobs:
build:
uses: ./.github/workflows/reusable-build.yml
with: { build-script: 'npm run build:backend' }
```
### 1.2 Name Jobs and Steps Consistently
Use clear, descriptive names for jobs and steps. This improves readability and debugging.
**❌ BAD: Vague Naming**
```yaml
jobs:
job1:
steps:
- run: echo "hello"
- run: npm test
# logs will show 'Run echo "hello"' and 'Run npm test'
```
**✅ GOOD: Descriptive Naming**
```yaml
jobs:
lint-and-test:
name: Lint & Test Code
steps:
- name: Run ESLint
run: npm run lint
- name: Run Unit Tests
run: npm test
```
### 1.3 Employ Matrix Strategies for Broad Testing
Test across multiple OSes, Node.js versions, or other configurations efficiently.
**❌ BAD: Separate Jobs for Each Variant**
```yaml
jobs:
test-node-18-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with: { node-version: '18' }
- run: npm test
test-node-20-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm test
```
**✅ GOOD: Single Job with Matrix**
```yaml
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: ['18', '20']
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/setup-node@v4
with: { node-version: ${{ matrix.node-version }} }
- run: npm test
```
### 1.4 Set Explicit Concurrency Groups
Prevent simultaneous runs on the same environment, especially for deployments.
**❌ BAD: Overlapping Deployments**
```yaml
jobs:
deploy:
environment: production
# Multiple pushes could trigger concurrent deployments
```
**✅ GOOD: Enforced Concurrency**
```yaml
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
concurrency: production_deployment # Only one 'production_deployment' can run at a time
steps:
- name: Deploy to Production
run: deploy-script.sh
```
## 2. Performance Considerations
Optimize your workflows for speed and cost-efficiency.
### 2.1 Cache Dependencies
Significantly reduce build times by caching `node_modules`, `pip` packages, etc.
**❌ BAD: Reinstalling Dependencies Every Run**
```yaml
steps:
- run: npm ci # Always downloads everything
```
**✅ GOOD: Smart Caching**
```yaml
steps:
- uses: actions/cache@v4
with:
path: ~/.npm # Or node_modules, ~/.cache/pip, etc.
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
```
## 3. Code Quality & Maintainability
Enforce high standards and ensure supply chain integrity.
### 3.1 Run Linters, Formatters, and Static Analysis Early
Catch issues before they merge. Complement with local pre-commit hooks.
**❌ BAD: No Early Checks**
```yaml
jobs:
build:
steps:
- run: npm run build # Build fails due to linting errors discovered late
```
**✅ GOOD: Shift-Left Quality Checks**
```yaml
jobs:
lint:
name: Lint Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: npm run lint # Fail fast
test:
name: Run Tests
runs-on: ubuntu-latest
needs: lint # Only run tests if lint passes
steps:
# ...
```
### 3.2 Pin Third-Party Actions to a Specific SHA or Version Tag
Prevent unexpected changes from breaking your workflows or introducing vulnerabilities.
**❌ BAD: Floating Version Tag**
```yaml
uses: actions/checkout@v4 # v4 could update at any time
```
**✅ GOOD: Specific Version Tag or SHA**
```yaml
uses: actions/checkout@v4.1.1 # Pin to specific patch
# OR (most secure)
uses: actions/checkout@a81bbbf8298bb0ba8a753697672f0999c0179a61 # Pin to specific SHA
```
## 4. Security Hardening & Configuration Management
Protect your secrets and mitigate common attack vectors.
### 4.1 Store All Secrets in GitHub Secrets
Never hardcode sensitive values. Use GitHub's built-in secret management.
**❌ BAD: Hardcoded Secrets**
```yaml
env:
API_KEY: "sk_test_12345" # Exposed in workflow file
```
**✅ GOOD: GitHub Secrets**
```yaml
env:
API_KEY: ${{ secrets.MY_API_KEY }} # Securely referenced
```
### 4.2 Apply Principle of Least Privilege to `GITHUB_TOKEN`
Set default `GITHUB_TOKEN` permissions to read-only, then elevate only when necessary for specific jobs.
**❌ BAD: Overly Permissive Default**
```yaml
permissions: write-all # Grants write access to many scopes by default
jobs:
build:
# ...
deploy:
# ...
```
**✅ GOOD: Granular Permissions**
```yaml
permissions:
contents: read # Default to read-only for all jobs
jobs:
build:
# No additional permissions needed
steps:
# ...
deploy:
permissions:
contents: write # Elevate only for this job to push changes
steps:
# ...
```
### 4.3 Mask Sensitive Data in Logs
Use `::add-mask::` for any non-GitHub secret sensitive values that might appear in logs.
**❌ BAD: Printing Sensitive Output**
```yaml
- run: echo "Debug info: ${{ env.TEMP_TOKEN }}" # TEMP_TOKEN will be visible
```
**✅ GOOD: Masking Output**
```yaml
- run: echo "::add-mask::${{ env.TEMP_TOKEN }}"
- run: echo "Debug info: ${{ env.TEMP_TOKEN }}" # TEMP_TOKEN will be masked
```
### 4.4 Mitigate Script Injection Attacks
Always pass untrusted input (e.g., from `github.event.pull_request.title`) to scripts via environment variables, not direct interpolation.
**❌ BAD: Direct Interpolation**
```yaml
- run: echo "Title: ${{ github.event.pull_request.title }}" # Vulnerable to `"; rm -rf /"`
```
**✅ GOOD: Intermediate Environment Variable**
```yaml
- name: Check PR Title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
if [[ "$PR_TITLE" =~ ^feat ]]; then
echo "Feature PR"
fi
```
## 5. Common Pitfalls & Gotchas
Be aware of these common issues to avoid debugging headaches.
### 5.1 Debugging with `ACTIONS_STEP_DEBUG`
Enable verbose logging for a specific workflow run to diagnose issues.
**❌ BAD: Guessing at Failures**
```yaml
# Workflow fails, no extra info
```
**✅ GOOD: Enable Debugging**
1. Go to your repository settings.
2. Navigate to "Secrets and variables" -> "Actions" -> "Repository secrets".
3. Add a new repository secret: `ACTIONS_STEP_DEBUG` with value `true`.
4. Rerun the workflow.
5. **Remember to delete the secret after debugging!**
### 5.2 Correct Use of Conditional Logic
Use `if` conditions for steps or jobs effectively.
**❌ BAD: Incorrect `if` syntax**
```yaml
- name: Deploy if main
if: github.ref == 'main' # This is for steps, not jobs
run: deploy.sh
```
**✅ GOOD: Proper `if` Placement**
```yaml
jobs:
deploy:
if: github.ref == 'refs/heads/main' # Condition for the entire job
steps:
- name: Deploy to Production
if: success() # Condition for a step
run: deploy.sh
```
## 6. Testing Approaches
Integrate robust testing into your CI/CD pipeline.
### 6.1 Implement Code Scanning
Use GitHub's built-in code scanning to find security vulnerabilities early.
**❌ BAD: No Automated Security Scans**
```yaml
# Relying solely on manual review for security
```
**✅ GOOD: Integrated Code Scanning**
```yaml
jobs:
code-scan:
name: Code Scanning
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
- uses: github/codeql-action/init@v3
with: { languages: javascript }
- uses: github/codeql-action/autobuild@v3
- uses: github/codeql-action/analyze@v3
```