Skip to content

GitHub Actions

The wrapd-sh/wrapd/github-action action lets you call any Wrapd endpoint from a GitHub Actions workflow. Output streams to CI logs in real time, and the step fails automatically on non-zero exit codes.

- uses: wrapd-sh/wrapd/github-action@main
with:
username: myuser
endpoint: deploy
api_key: ${{ secrets.WRAPD_API_KEY }}
InputRequiredDefaultDescription
usernameYesYour Wrapd username
endpointYesEndpoint slug to trigger
api_keyYesWrapd API key (use GitHub secrets)
paramsNoJSON or YAML key-value pairs
streamNotrueStream stdout to CI logs
timeoutNo300Max seconds to wait
api_urlNohttps://api.wrapd.shAPI base URL (for self-hosted)
OutputDescription
exit_codeExit code from the command
outputFull stdout output

Parameters can be passed as JSON or simple YAML key-value pairs:

# JSON format
- uses: wrapd-sh/wrapd/github-action@main
with:
username: myuser
endpoint: deploy
api_key: ${{ secrets.WRAPD_API_KEY }}
params: '{"branch": "main", "environment": "staging"}'
# YAML format
- uses: wrapd-sh/wrapd/github-action@main
with:
username: myuser
endpoint: deploy
api_key: ${{ secrets.WRAPD_API_KEY }}
params: |
branch: main
environment: staging

Access the exit code and output in subsequent steps:

- uses: wrapd-sh/wrapd/github-action@main
id: wrapd
with:
username: myuser
endpoint: health-check
api_key: ${{ secrets.WRAPD_API_KEY }}
- run: echo "Exit code was ${{ steps.wrapd.outputs.exit_code }}"
- run: echo "${{ steps.wrapd.outputs.output }}"
name: Deploy to staging
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: wrapd-sh/wrapd/github-action@main
with:
username: myteam
endpoint: deploy
api_key: ${{ secrets.WRAPD_API_KEY }}
params: |
branch: ${{ github.ref_name }}
commit: ${{ github.sha }}
timeout: '600'

Always store your API key as a GitHub secret — never hardcode it in workflow files.