Octopus GitHub Action "server and api_key are required" in CI
The OctopusDeploy GitHub Actions (push-package-action, create-release-action, or the login/deploy actions) require a server URL and API key. When those inputs or the OCTOPUS_URL / OCTOPUS_API_KEY environment variables are not provided, the action fails validation before contacting Octopus.
What this error means
A workflow step using OctopusDeploy/push-package-action or create-release-action fails with "Input required and not supplied" or "server and api_key are required".
Error: The 'server' and 'api_key' inputs are required.
at OctopusDeploy/push-package-actionCommon causes
Required inputs are missing
The step did not pass server and api_key (or the OCTOPUS_URL / OCTOPUS_API_KEY env vars the action reads), so its input validation fails.
The secret was never configured
The workflow references secrets.OCTOPUS_API_KEY, but that secret does not exist in the repository or environment, so the input resolves to empty.
How to fix it
Provide server and api_key to the action
- Add OCTOPUS_URL and OCTOPUS_API_KEY as repository or environment secrets.
- Pass them via the action inputs or the documented env vars.
- Re-run the workflow so the action has both values.
- uses: OctopusDeploy/push-package-action@v3
env:
OCTOPUS_URL: ${{ secrets.OCTOPUS_URL }}
OCTOPUS_API_KEY: ${{ secrets.OCTOPUS_API_KEY }}
with:
space: 'Default'
packages: 'Web.1.0.0.zip'Use the login action once per job
The OctopusDeploy/login action can set the connection once so later steps inherit server and api_key instead of repeating them.
- uses: OctopusDeploy/login@v1
with:
server: ${{ secrets.OCTOPUS_URL }}
api_key: ${{ secrets.OCTOPUS_API_KEY }}How to prevent it
- Store OCTOPUS_URL and OCTOPUS_API_KEY as secrets before using the actions.
- Set the connection once with the login action per job.
- Reference the exact secret names the workflow expects.