Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ If the author cannot be resolved via either method, or the GitHub API is
unreachable, the check fails with a clear error.

For private repositories, set `GITHUB_TOKEN` or `GH_TOKEN` so the Commits API
can authenticate.
can authenticate. The official GitHub Action wires the workflow's automatic
token via the `github-token` input, so no manual `env:` is required; override
with a PAT only for cross-repo lookups.

### Configuration file

Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ inputs:
output-file:
description: Write JSONL results to this file path (text still goes to stdout)
required: false
github-token:
description: GitHub token for Commits API access (signature check). Defaults to
the workflow's automatic token; override with a PAT for cross-repo lookups.
required: false
default: ${{ github.token }}
outputs:
output-file:
description: Path to the JSONL output file (set only when output-file input is provided)
Expand All @@ -76,6 +81,7 @@ runs:
- name: Run commit-guard
id: run
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
CG_REV: ${{ inputs.rev }}
CG_RANGE: ${{ inputs.range }}
CG_ENABLE: ${{ inputs.enable }}
Expand Down
5 changes: 4 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,10 @@ <h3>Signature verification</h3>
If the author cannot be resolved via either method, or the GitHub API
is unreachable, the check fails with a clear error. For private
repositories, set <code>GITHUB_TOKEN</code> or <code>GH_TOKEN</code>
so the Commits API can authenticate. Disable the
so the Commits API can authenticate. The official GitHub Action wires
the workflow's automatic token via the <code>github-token</code>
input, so no manual <code>env:</code> is required; override with a
PAT only for cross-repo lookups. Disable the
<code>signature</code> check if GitHub API access is unavailable:
</p>
<pre><code class="language-bash">commit-guard --disable signature</code></pre>
Expand Down
Loading