Actions "Input required and not supplied: token" in CI
An action declared token as a required input and received an empty string. The most common cause is referencing a secret that is undefined or withheld (for example on a fork PR), so the expression resolves to nothing.
What this error means
A step fails immediately with "Error: Input required and not supplied: token". The action got with: token: set to an empty value.
Error: Input required and not supplied: tokenCommon causes
The referenced secret is empty or missing
A secret that is not defined at this scope, or withheld on a fork PR, evaluates to an empty string passed to the required input.
The token input was never wired up
The step omits with: token: (or passes a misspelled secret), so the action falls back to nothing for a required input.
How to fix it
Pass a valid token to the action
- Confirm the secret exists at the right scope and name.
- Wire it explicitly to the action's
tokeninput. - Use GITHUB_TOKEN when the action only needs repo scope.
- uses: some/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}Guard the step for fork PRs
If the token is unavailable on fork PRs, skip the step there instead of letting it fail.
- if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
uses: some/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}How to prevent it
- Wire required token inputs to a defined secret explicitly.
- Confirm secret scope and name before relying on it.
- Guard token-using steps on fork pull requests.