How to audit GitHub Actions across an organisation
Last reviewed: 1 December 2026, against SecureCI CLI 1.5.0
The GitHub audit log tells you who changed settings. It does not list what your workflows run. To audit GitHub Actions across an organisation, you need an inventory of every workflow and the third-party actions it uses, with their versions and pin status, plus checks against your standards. SecureCI’s free, open-source CLI does this with one command, secureci org scan <org>. It reads .github/ in every repository, never your application code, and writes JSON results you can query or send to us for a free assessment.
Short answer:
- Token: set
GITHUB_TOKENto a token withcontents: readandmetadata: read. - Read first:
secureci org scan --print-script | less. - Scan:
secureci org scan my-org. - Query: use
jqonmanifest.json,validate.jsonandinventory/*.json. - Fix: per repository,
secureci pin, commitsecureci.lock, add PR checks.
What a GitHub Actions audit should answer
Whether the audit is for a security review, a supplier questionnaire or a compliance control, the questions are much the same:
- Workflows: which repositories have workflows, and how many?
- Third-party actions: which actions run, from which owners, in which repositories?
- Versions: is each action pinned to a commit SHA, or does it follow a tag that can be moved?
- Known advisories: does any workflow use an action version with a published security advisory?
- Token scope: which workflows give
GITHUB_TOKENmore access than they need? - Dangerous patterns: which workflows run fork code under
pull_request_targetor expand untrusted input into a script? - Standards: which workflows break your own pipeline rules, such as a required scan step?
The audit log vs a workflow inventory
The organisation audit log records events. It shows who changed a secret, a policy or a repository setting, and when. That is useful evidence, but it can’t tell you that forty repositories run tj-actions/changed-files on a tag.
The answer to that question lives in the workflow files themselves. So an audit has two halves. The audit log covers changes to settings. A workflow inventory covers what actually runs. This guide is about the second half.
Option 1: by hand with the GitHub API
For a handful of repositories, the GitHub CLI can list the uses: lines in every workflow:
ORG=my-org
gh api --paginate "orgs/$ORG/repos?per_page=100" \
--jq '.[] | select(.archived | not) | .full_name' |
while read -r repo; do
gh api "repos/$repo/contents/.github/workflows" \
--jq '.[] | select(.type == "file") | .path' 2>/dev/null |
while read -r wf; do
gh api "repos/$repo/contents/$wf" -H 'Accept: application/vnd.github.raw' |
grep -oE 'uses:[[:space:]]*[^[:space:]#]+' |
sed "s|^uses:[[:space:]]*|$repo |"
done
done | sort -u
That gives a list of references. It breaks down as the organisation grows:
- Rate limits: it makes one API call per workflow file, on top of the listing.
- It only sees the first level. Actions used inside a composite action or a reusable workflow are not listed.
- It finds names, not problems. You still have to check pin status, advisories, permissions and triggers for each line yourself.
Option 2: scan every repository with secureci org scan
secureci org scan <org> (since v1.1.0) runs two checks on every repository in an organisation or user account. For each one, it makes a shallow, sparse clone of .github/ only, so application code is never downloaded. It runs secureci validate --format json on the workflows and secureci inventory --dry-run on each workflow. Then it saves the JSON and deletes the clone. Install the CLI with npm install -g @secureci/cli (Node.js 20 or later), or use the standalone binary.
Token and scopes
Set GITHUB_TOKEN (or GH_TOKEN) to a token that can read the organisation’s repositories, with contents: read and metadata: read. A fine-grained, read-only token is enough. Without one, only public repositories are listed, and API rate limits stop large scans.
The token stays on your machine. The script passes it to curl on stdin and to git through environment variables, so it never appears on a command line. It is not written to any output file.
Read the script first
The command runs org-scan.sh, a short bash script. Read exactly what will run before you run it:
secureci org scan --print-script | less
# or, without the CLI command:
curl -fsSL https://secure-ci.dev/org-scan.sh -o org-scan.sh
less org-scan.sh
It needs bash, git 2.31+, curl, base64 and tar. On Windows, run it from Git Bash or WSL.
Run and scope the scan
GITHUB_TOKEN=... secureci org scan my-org
Archived repositories are skipped, and so are forks. Four options change that:
--repos <file>scans only the repositories listed, onenameorowner/nameper line, with#comments allowed. Start with a pilot team this way.--include-forksalso scans forked repositories.--out <dir>sets the output directory. The default is./secureci-org-scan-<org>, and the archive is<dir>.tar.gz.--contract <file>also checks every workflow against a pipeline contract (see below).
We ran the scan on a test organisation, acme, with three repositories made for this guide: api (two workflows on tags), web (a pull_request_target workflow) and docs (no workflows). This is the real output of CLI 1.5.0, shortened:
$ secureci org scan acme --repos repos.txt
secureci-org-scan: [1/3] acme/api: scanned (2 workflows)
secureci-org-scan: [2/3] acme/web: scanned (1 workflows)
secureci-org-scan: [3/3] acme/docs: no-workflows (0 workflows)
Scanned 3 repositories in acme: 2 scanned, 1 without workflows, 0 failed.
Results: ./secureci-org-scan-acme/
Archive: ./secureci-org-scan-acme.tar.gz
Check against your own standards
An audit often has a second question: does each workflow follow the organisation’s golden path? A pipeline contract sets the rules: required and forbidden actions, their order, minimum versions, SHA pinning, allowed owners and a token permissions policy. Pass it to the scan and each validate.json also holds the contract findings:
secureci org scan my-org --contract contracts/standard.yml
GitHub Enterprise Server
Set GITHUB_SERVER_URL to your server. The API defaults to $GITHUB_SERVER_URL/api/v3. If yours is elsewhere, set GITHUB_API_URL too:
GITHUB_SERVER_URL=https://github.example.com \
GITHUB_TOKEN=... secureci org scan my-org
Read the results
The output directory holds three kinds of file, and nothing else: no source code, and not your token.
secureci-org-scan-acme/
manifest.json
errors.log
repos/acme__api/validate.json
repos/acme__api/inventory/ci.yml.json
repos/acme__api/inventory/release.yml.json
repos/acme__web/validate.json
repos/acme__web/inventory/pr.yml.json
manifest.jsonrecords the organisation, server, time, CLI and script versions and the contract. It lists each repository with its status (scanned,no-workflowsorclone-failed) and its workflow count.validate.jsonholds the findings for the repository’s workflows. Each has apath, amessage, aseverityand arule, such assecureci/permissions.inventory/<workflow>.jsonlists every action reference:uses,owner,repo,ref,pinnedand thepathswhere it appears. Actions pulled in by a composite action or reusable workflow carryvia. Known advisories are inadvisories.errors.logholds git and CLI messages, such as a repository that failed to clone or advisories that couldn’t be checked. Read it before you trust a clean result.
The CLI does not print a summary report of the archive. The queries below are examples with jq, run from inside the output directory. The output shown is from the acme scan above.
Which third-party actions run, and in how many repositories?
$ jq -r 'input_filename as $f | .actions[]
| "\(.owner)/\(.repo)\t\($f | split("/")[1])"' repos/*/inventory/*.json \
| sort -u | cut -f1 | sort | uniq -c | sort -rn
2 actions/checkout
1 tj-actions/changed-files
1 softprops/action-gh-release
1 actions/setup-node
Which references are not pinned to a commit SHA?
$ jq -r 'input_filename as $f | .actions[]
| select(.kind == "action" and .pinned == false)
| "\($f | split("/")[1])\t\(.uses)"' repos/*/inventory/*.json | sort -u
acme__api actions/checkout@v4
acme__api actions/setup-node@v4
acme__api softprops/action-gh-release@v2
acme__api tj-actions/changed-files@v45.0.7
The pinned actions/checkout in web is not listed. Every tag here could be moved to different code tomorrow.
Which workflows have findings, by rule?
$ jq -r '(.files // [.])[] | .errors[]
| "\(.severity)\t\(.rule)"' repos/*/validate.json | sort | uniq -c | sort -rn
2 warning secureci/permissions
1 error secureci/injection
1 error secureci/dangerous-trigger
A repository with one workflow gets a single result object, and one with several gets a files list, so the query reads both with (.files // [.]). In acme, both errors are in web/.github/workflows/pr.yml: a pull request title expanded into a run: script, and fork code checked out and run under pull_request_target. Both warnings are in api: one workflow declares no permissions and the other uses write-all.
Which actions have known advisories?
jq -r 'input_filename as $f | .advisories[]
| "\(.severity)\t\(.uses)\t\(.ghsaId)\t\($f | split("/")[1])"' repos/*/inventory/*.json
The advisory check needs to reach the GitHub API. In our test run it couldn’t, so this query printed nothing, and errors.log said so for each repository:
[WARN] Security advisories not checked for actions/checkout, softprops/action-gh-release, tj-actions/changed-files (connect ECONNREFUSED 127.0.0.1:9).
That is why you read errors.log. With network access, tj-actions/changed-files@v45.0.7 is reported with GHSA-mrrh-fwg8-r2c3 (high), as the secrets guide shows. See known security advisories for how versions are matched.
Want this read for you? Run the scan and send us the archive for a free supply-chain assessment, or join early access for the read-only GitHub App. Request an assessment →
Fix what you find, one repository at a time
The scan is read-only. Fixes happen in each repository, with the same CLI:
- Pin actions.
secureci pinrewrites each tag to the commit SHA it points at now and keeps the tag as a comment, so Dependabot and Renovate still offer updates. See how to pin GitHub Actions to a commit SHA. - Lock them.
secureci inventorywritessecureci.lock, which records the commit for every action, including the ones inside your actions.secureci inventory --checkfails when a tag moves. See action inventory and drift. - Narrow the token. Set a read-only top-level
permissions:block and grant write scopes per job. See least-privilege GitHub Actions permissions. - Check every pull request.
secureci init workflowwrites a pinned workflow that runs the SecureCI GitHub Action on each pull request. See use in CI.
Then run the scan again and compare the two archives. The org-wide SecureCI platform is in early access. Continuous monitoring and drift alerts across an organisation aren’t available yet, so for now a repeat scan is how you track progress. The compliance mapping shows which controls this evidence supports.
Get a free supply-chain assessment
If you would rather have the results read for you, send us the archive. Check what is in it first:
tar -tzf secureci-org-scan-my-org.tar.gz
It holds only JSON results (repository and workflow names, the actions they use and the findings) plus errors.log. Email it to hello@secure-ci.dev. If your policy doesn’t allow that, write to us there and we’ll agree another way. The assessment is free, and we delete the results 30 days after we deliver the report.
Scan your organisation now
The SecureCI CLI is free and open source (MIT), for public and private repositories. It needs Node.js 20+, or use the standalone binary.
npm install -g @secureci/cli
secureci org scan --print-script | less
GITHUB_TOKEN=... secureci org scan my-org
Want this done for you? Run the scan and send us the archive for a free supply-chain assessment, or join early access for the read-only GitHub App. Request an assessment →
FAQ
How do I see which GitHub Actions are used in my organisation?
Scan the workflow files of every repository. secureci org scan <org> lists every repository, reads .github/ from each, and writes an inventory per workflow: every uses: reference, its owner, version, whether it is pinned to a commit SHA and where it appears.
Does the GitHub audit log show which actions ran?
No. The audit log records events, such as who changed a setting, a secret or a policy. It does not list the actions referenced in your workflow files or the versions they use. For that you need an inventory of the workflows themselves.
Can I audit GitHub Actions without cloning source code?
Yes. secureci org scan makes a shallow, sparse clone of the .github/ directory only, so application code is never downloaded. It deletes each clone after scanning and writes only JSON results.
Does this work on GitHub Enterprise Server?
Yes. Set GITHUB_SERVER_URL to your server, for example https://github.example.com. The API defaults to $GITHUB_SERVER_URL/api/v3, and you can override it with GITHUB_API_URL.
What token permissions does an organisation scan need?
Read access to the organisation’s repositories: contents: read and metadata: read. Without a token only public repositories are listed and API rate limits stop large scans. The token is never put on a command line or written to the results.
Limits
- Local actions outside
.github/(uses: ./tools/my-action) aren’t cloned, sovalidatereports them as not found. Actions inside.github/are checked as usual. - It reads files, not settings. The scan can’t see your organisation’s allowed-actions policy, secrets or default token permissions. Use the audit log and organisation settings for those.
- It is a snapshot. A workflow changed after the scan is not covered until the next one, or until pull request checks catch it.