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.
Quick start
Section titled “Quick start”- uses: wrapd-sh/wrapd/github-action@main with: username: myuser endpoint: deploy api_key: ${{ secrets.WRAPD_API_KEY }}Inputs
Section titled “Inputs”| Input | Required | Default | Description |
|---|---|---|---|
username | Yes | — | Your Wrapd username |
endpoint | Yes | — | Endpoint slug to trigger |
api_key | Yes | — | Wrapd API key (use GitHub secrets) |
params | No | — | JSON or YAML key-value pairs |
stream | No | true | Stream stdout to CI logs |
timeout | No | 300 | Max seconds to wait |
api_url | No | https://api.wrapd.sh | API base URL (for self-hosted) |
Outputs
Section titled “Outputs”| Output | Description |
|---|---|
exit_code | Exit code from the command |
output | Full stdout output |
Passing parameters
Section titled “Passing parameters”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: stagingUsing outputs
Section titled “Using outputs”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 }}"Full workflow example
Section titled “Full workflow example”name: Deploy to stagingon: 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'Security
Section titled “Security”Always store your API key as a GitHub secret — never hardcode it in workflow files.