Skip to content
Latchkey

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".

GitHub Actions
Error: The 'server' and 'api_key' inputs are required.
    at OctopusDeploy/push-package-action

Common 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

  1. Add OCTOPUS_URL and OCTOPUS_API_KEY as repository or environment secrets.
  2. Pass them via the action inputs or the documented env vars.
  3. Re-run the workflow so the action has both values.
.github/workflows/ci.yml
- 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.

.github/workflows/ci.yml
- 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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →