A GitHub Action that scans your repository's workflow files and submits action dependencies to GitHub's Dependency Graph with fork traversal support.
- 🔍 Automatic Workflow Scanning: Scans
.github/workflowsdirectory for GitHub Actions dependencies - 📦 Composite Actions: Recursively scans local composite actions for nested dependencies
- 🔄 Callable Workflows: Detects and processes callable workflows referenced from workflows
- 🎯 Additional Paths: Supports scanning custom directories for composite actions and callable workflows
- 🔀 Fork Traversal: Detects forked actions and submits both the fork and original repository as dependencies
- 🔗 GitHub API Integration: Uses GitHub's fork relationship to find original repositories
- 🎯 Regular Expression Pattern Matching: Supports custom regular expression patterns for repositories without fork relationships (e.g., EMU or GitHub-DR)
- 📊 Dependency Graph Integration: Submits dependencies to GitHub's Dependency Graph for security advisory tracking
name: Submit Dependencieson: push: branches: [main]schedule: - cron: '0 0 * * 0'# Weeklyjobs: submit-dependencies: runs-on: ubuntu-latestpermissions: contents: write # Required for dependency submissionsteps: - uses: actions/checkout@v4 - uses: jessehouwing/actions-dependency-submission@v1with: token: ${{secrets.GITHUB_TOKEN }}If your enterprise uses forked actions (e.g., myenterprise/actions-checkout as a fork of actions/checkout):
- uses: jessehouwing/actions-dependency-submission@v1with: token: ${{secrets.GITHUB_TOKEN }}fork-organizations: 'myenterprise,myorg'This will submit both myenterprise/actions-checkout and the original actions/checkout as dependencies, ensuring security advisories for the original repository also apply to your fork.
For cases where fork relationships don't exist (e.g., EMU or GitHub-DR environments):
- uses: jessehouwing/actions-dependency-submission@v1with: token: ${{secrets.GITHUB_TOKEN }}fork-organizations: 'myenterprise'fork-regex: '^myenterprise/(?<org>[^_]+)_(?<repo>.+)'The regular expression must contain named captures org and repo to identify the original repository. In this example:
myenterprise/actions_checkoutwould resolve toactions/checkout- This is useful when forks follow a naming convention but don't have GitHub fork relationships
If you store composite actions or callable workflows in custom directories:
- uses: jessehouwing/actions-dependency-submission@v1with: token: ${{secrets.GITHUB_TOKEN }}additional-paths: | .github/actions custom/workflows shared/actionsThis will:
- Scan the specified directories for composite actions (identified by
runs.using: composite) - Recursively extract dependencies from those composite actions
- Include dependencies from callable workflows (identified by
on.workflow_call) - Process local action references (e.g.,
uses: ./local-action) in workflows
If you're running on GitHub Enterprise Managed Users (EMU), GitHub Disaster Recovery (GitHub-DR), or GitHub Enterprise Server (GHES), and your workflows reference actions from public GitHub that aren't mirrored to your instance:
jobs: submit-dependencies: runs-on: ubuntu-latestpermissions: contents: write # Required for dependency submissionsteps: - uses: actions/checkout@v4 - uses: jessehouwing/actions-dependency-submission@v1with: token: ${{secrets.GITHUB_TOKEN }}fork-organizations: 'myenterprise'public-github-token: ${{secrets.PUBLIC_GITHUB_TOKEN }}This configuration:
- Uses
tokento access your local GitHub instance and submit dependencies - Uses
public-github-tokento look up actions on public GitHub (api.github.com) when they're not found on your local instance - Automatically determines whether each action lives on your local instance or public GitHub
- Caches the location decision to minimize API calls
- Resolves fork relationships and SHA-to-version mappings from the appropriate source
Note: The public-github-token requires contents: read permission for accessing public repositories on GitHub.com. See the environment-specific documentation for detailed setup instructions for different token types.
By default, all dependencies (including transitive dependencies from composite actions and original repositories from forks) are reported as "direct" dependencies. This ensures that GitHub's Dependency Graph will report vulnerabilities for all dependencies.
If you want to distinguish between direct and transitive dependencies:
- uses: jessehouwing/actions-dependency-submission@v1with: token: ${{secrets.GITHUB_TOKEN }}report-transitive-as-direct: falseWith report-transitive-as-direct: false:
- Dependencies directly referenced in your workflows are marked as "direct"
- Dependencies from composite actions are marked as "indirect"
- Original repositories (when using forked actions) are marked as "indirect"
Note: GitHub's Dependency Graph only reports vulnerabilities for "direct" dependencies. Setting this to false means you won't receive vulnerability alerts for transitive dependencies and original repositories.
| Input | Description | Required | Default |
|---|---|---|---|
token | GitHub token for API access and dependency submission | Yes | ${{github.token }} |
repository | Repository to submit dependencies for (owner/repository format) | No | ${{github.repository }} |
workflow-directory | Directory containing workflow files to scan | No | .github/workflows |
additional-paths | Additional paths to scan for composite actions and callable workflows (comma-separated or newline-separated) | No | - |
fork-organizations | Comma-separated list of organization names that contain forked actions | No | - |
fork-regex | Regular expression pattern to transform forked repository names. Must contain named captures org and repo | No | - |
public-github-token | GitHub token for accessing public GitHub (api.github.com) when running on EMU, GitHub-DR, or GHES. Used to look up actions not on local instance | No | - |
report-transitive-as-direct | Whether to report transitive dependencies as direct. When true (default), all dependencies are reported as direct to enable vulnerability reporting. When false, transitive dependencies are indirect. | No | true |
| Output | Description |
|---|---|
dependency-count | Number of dependencies submitted to the Dependency Graph |
- Workflow Scanning: The action scans all
.ymland.yamlfiles in the specified workflow directory - Dependency Extraction: Parses each workflow file to extract
uses:statements that reference GitHub Actions - Local Action Processing: Detects local action references (e.g.,
uses: ./local-action):- Resolves the path relative to the workflow file
- Checks if it's a composite action
- Recursively extracts dependencies from the composite action
- Callable Workflow Processing: Detects callable workflow references (e.g.,
uses: ./workflow.ymlat job level):- Processes the callable workflow
- Extracts all action dependencies from it
- Additional Paths Scanning: If specified, scans additional directories for composite actions:
- Finds all YAML files in the specified paths
- Processes composite actions found there
- Recursively extracts their dependencies
- Fork Detection: For actions from organizations in the
fork-organizationslist:- First tries to apply the
fork-regexpattern if provided - Falls back to checking GitHub's fork relationship via the API
- First tries to apply the
- EMU/DR/GHES Support: When
public-github-tokenis provided:- Determines whether each action repository exists on the local GitHub instance or public GitHub
- Caches this decision to avoid redundant API calls
- Uses the appropriate API endpoint for all subsequent operations on that repository
- Enables looking up fork relationships and SHA-to-version mappings from public GitHub when needed
- Dependency Submission: Submits all dependencies to GitHub's Dependency Graph:
- For forked actions, submits both the fork and original repository
- Uses Package URL (purl) format:
pkg:github/{owner}/{repo}@{ref}
- Security Advisories: GitHub automatically matches submitted dependencies against its security advisory database
When you use forked GitHub Actions in your workflows, GitHub's Dependabot and security advisories only track the fork, not the original repository. This means:
- Security vulnerabilities in the original action won't trigger alerts for your fork
- You won't be notified when the original action has security updates
This action solves this problem by submitting both repositories as dependencies, ensuring you receive security advisories for both the fork and the original.
Your enterprise has forked actions/checkout to myenterprise/actions-checkout for additional security controls. Your workflows use:
- uses: myenterprise/actions-checkout@v4Without this action, you only get security advisories for myenterprise/actions-checkout. With this action configured, you'll receive advisories for both:
myenterprise/actions-checkout@v4actions/checkout@v4
The action requires the following permissions:
jobs: submit-dependencies: runs-on: ubuntu-latestpermissions: contents: write # Required for dependency submissionsteps: # ... your stepsImportant Notes:
- Always define permissions at the job level, not at the workflow level, to follow the principle of least privilege
- The primary
tokenrequirescontents: writepermission to submit dependencies - If your workflows reference private or internal actions in other repositories, you must configure repository access settings. See Allowing access to components in a private repository
- The optional
public-github-token(for EMU/DR/GHES) requirescontents: readpermission for public repositories on GitHub.com
For detailed guidance on token permissions for different environments, see the Environment-Specific Documentation.
For detailed configuration instructions, token setup, and best practices specific to your environment, please refer to the appropriate guide:
- GitHub Public / GitHub Enterprise Cloud - Standard GitHub.com and GHEC environments
- GitHub Enterprise Managed Users (EMU) - EMU environments with forked actions
- GitHub Disaster Recovery (GitHub-DR) - GitHub-DR environments with action synchronization
- GitHub Enterprise Server (GHES) - Self-hosted GHES instances
Each guide covers:
- ✅ Using workflow tokens (
GITHUB_TOKEN) - ✅ Using GitHub App tokens (recommended for cross-repository access)
- ✅ Using personal access tokens (with security warnings)
- ✅ Required permissions for each token type
- ✅ Handling private and internal actions
- ✅ Complete working examples
- ✅ Advantages and disadvantages of each approach
- ✅ Environment-specific considerations
Install dependencies:
npm install
Run tests:
npm testBundle the action:
npm run bundle
The action includes comprehensive unit tests for:
- Workflow file parsing
- Fork resolution via GitHub API
- Regular expression pattern matching
- Dependency submission
Run tests with coverage:
npm run allMIT
Contributions are welcome! Please feel free to submit a Pull Request.