@stoe/action-reporting-cli v4.0.0-alpha.1
action-reporting-cli
CLI to report on GitHub Actions usage across enterprises, organizations, users, and repositories
action-reporting-cli helps you audit GitHub Actions usage across your GitHub environment by collecting comprehensive data about workflows, actions, secrets, variables, permissions, and dependencies. It supports GitHub.com, GitHub Enterprise Cloud, and GitHub Enterprise Server.
Table of Contents
Installation
Using npx (recommended)
Run without installing:
$ npx @stoe/action-reporting-cli [--options]Global Installation
$ npm install -g @stoe/action-reporting-cli
$ action-reporting-cli [--options]Local Installation
$ npm install @stoe/action-reporting-cli
$ npx action-reporting-cli [--options]Authentication
The tool requires a GitHub Personal Access Token (PAT) with appropriate permissions:
For GitHub.com and GitHub Enterprise Cloud:
reposcope for private repositoriesworkflowscope to access GitHub Actions dataadmin:orgscope when using--ownerfor organizations
For GitHub Enterprise Server:
- Same permissions as above
- Ensure network access to your GitHub Enterprise Server instance
You can provide the token using the --token parameter or via the GITHUB_TOKEN environment variable.
Usage
The tool requires one target scope to analyze (enterprise, owner, or repository):
# Basic usage pattern
$ action-reporting-cli --<scope> <name> --<report-options> --<output-options>Options
Target Scope (Required, choose one)
--enterprise,-eGitHub Enterprise (Cloud|Server) account slug (e.g. enterprise).--owner,-oGitHub organization/user login (e.g. owner). If--owneris a user, results for the authenticated user (--token) will be returned.--repository,-rGitHub repository name with owner (e.g. owner/repo).
Authentication and Connection
--token,-tGitHub Personal Access Token (PAT) (default: environment variableGITHUB_TOKEN).--hostnameGitHub Enterprise Server hostname or GitHub Enterprise Cloud with Data Residency region endpoint (default:api.github.com). For GitHub Enterprise Server:github.example.comFor GitHub Enterprise Cloud with Data Residency:api.example.ghe.com
Report Content Options
--allGenerate all report types listed below.--listenersReport workflowonevent listeners/triggers used.--permissionsReportpermissionsvalues set forGITHUB_TOKEN.--runs-onReportruns-onrunner environments used.--secretsReportsecretsreferenced in workflows.--usesReportusesstatements for actions referenced.--excludeExclude GitHub-created actions (from github.com/actions and github.com/github).--uniqueList unique GitHub Actions references. Values:true,false, orboth(default:false). Whentrueorboth, creates additional*-unique.{csv,json,md}report files.
--varsReportvarsreferenced in workflows.
Repository Filtering (for Enterprise/Owner Scopes)
--archivedSkip archived repositories (default:false).--forkedSkip forked repositories (default:false).
Output Format Options
--csvPath to save CSV output (e.g./path/to/reports/report.csv).--jsonPath to save JSON output (e.g./path/to/reports/report.json).--mdPath to save markdown output (e.g./path/to/reports/report.md).
Utility Options
--debug,-dEnable debug mode with verbose logging.--skipCacheDisable caching of API responses.--help,-hPrint action-reporting-cli help.--version,-vPrint action-reporting-cli version.
Report Files
The tool generates reports in your specified format(s) with the following naming convention:
- Enterprise reports:
enterprise.<slug>.[csv|json|md] - Organization reports:
org.<org-name>.[csv|json|md] - User reports:
user.<username>.[csv|json|md] - Repository reports:
repository.<owner>-<repo>.[csv|json|md]
When using --unique true or --unique both with --uses, additional files with .unique suffix are created.
Examples
Enterprise-Wide Audit
Generate a complete report on all GitHub Actions usage across an enterprise:
# Report on everything in the `my-enterprise` GitHub Enterprise Cloud account
$ npx @stoe/action-reporting-cli \
--token ghp_000000000000000000000000000000000000 \
--enterprise my-enterprise \
--all \
--csv ./reports/actions.csv \
--json ./reports/actions.json \
--md ./reports/actions.mdOrganization-Level Analysis
Focus on specific aspects of GitHub Actions in an organization:
# Report on permissions, runners, secrets, actions, and variables in a GitHub organization
$ npx @stoe/action-reporting-cli \
--token ghp_000000000000000000000000000000000000 \
--owner my-org \
--permissions \
--runs-on \
--secrets \
--uses \
--vars \
--json ./reports/actions.jsonRepository-Specific Report
Analyze unique third-party actions used in a specific repository:
# Report on unique third-party GitHub Actions in a specific repository
$ npx @stoe/action-reporting-cli \
--token ghp_000000000000000000000000000000000000 \
--repository my-org/myrepo \
--uses \
--exclude \
--unique both \
--csv ./reports/actions.csvGitHub Enterprise Server
Run the tool against GitHub Enterprise Server:
# Report on everything in an organization on GitHub Enterprise Server
$ npx @stoe/action-reporting-cli \
--hostname github.example.com \
--token ghp_000000000000000000000000000000000000 \
--owner my-org \
--all \
--json ./reports/actions.jsonUsing Environment Variables
Use environment variables for authentication:
# Set token as environment variable
$ export GITHUB_TOKEN=ghp_000000000000000000000000000000000000
# Run without specifying token in command
$ npx @stoe/action-reporting-cli \
--owner my-org \
--uses \
--csv ./reports/actions.csvAdvanced Usage
Filtering Repositories
Skip archived or forked repositories in an enterprise-wide scan:
$ npx @stoe/action-reporting-cli \
--enterprise my-enterprise \
--all \
--archived \
--forked \
--json ./reports/actions.jsonDebugging Issues
Enable debug mode for verbose logging:
$ npx @stoe/action-reporting-cli \
--repository my-org/myrepo \
--all \
--debug \
--md ./reports/actions.mdAPI Performance
Skip cache for fresh data (may increase API usage):
$ npx @stoe/action-reporting-cli \
--owner my-org \
--all \
--skipCache \
--json ./reports/actions.jsonContributing
Contributions to this project are welcome and appreciated! Whether you want to report a bug, suggest enhancements, or submit code changes, your help makes this project better.
Please see our contributing guidelines for detailed information on:
- How to submit bug reports and feature requests
- The development workflow and coding standards
- Pull request process and review expectations
- Project structure and architecture
Thank you to all our contributors!
Performance Considerations
- Set
--debugflag to see detailed progress information - For very large scans, consider targeting specific organizations or repositories
License
6 months ago
6 months ago
5 months ago
8 months ago
5 months ago
8 months ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago