Marks a deployment status for GitHub actions. Run it from a workflow triggered by the deployment event, or pass deployment-id.
state: Deployment state. (default: pending)description: Descriptive message about the deployment state.log-url: Log url location.token: GitHub token withdeployments: writepermission. (default:${{ github.token }})environment: Name for the target deployment environment, which can be changed when setting a deploy status.environment-url: URL for accessing your environment.deployment-id: ID of the deployment to update. (default: the deployment that triggered the workflow)
# .github/workflows/deploy.yml
name: Deploy
on: ["deployment"]
jobs:
deployment:
runs-on: "ubuntu-latest"
permissions:
deployments: write
steps:
- uses: actions/checkout@v7
- name: "deployment pending"
uses: "deliverybot/deployment-status@v2"
with:
state: "pending"
token: "${{ github.token }}"
- name: "deploy"
run: |
npm run deploy
- name: "deployment success"
if: success()
uses: "deliverybot/deployment-status@v2"
with:
state: "success"
token: "${{ github.token }}"
- name: "deployment failure"
if: failure()
uses: "deliverybot/deployment-status@v2"
with:
state: "failure"
token: "${{ github.token }}"This is a composite action that calls the GitHub API with the GitHub CLI (gh). GitHub-hosted runners include it. On self-hosted runners or in jobs that run inside a container:, make sure gh is installed.
The action is action.yml plus status.sh. Run the tests with:
shellcheck status.sh test/*.sh
test/status.test.shCI also runs the action against the real API by creating and then deleting a test deployment.