Skip to content

Commit a60e032

Browse files
authored
More meat on the README
And new url to documentation
1 parent 8626da4 commit a60e032

File tree

1 file changed

+56
-9
lines changed

1 file changed

+56
-9
lines changed

README.md

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,65 @@
22

33
This Github actions adds functions for creating a status on the github deployment api.
44

5-
It is a small wrapper for your workflows to use the Github Deployment Status API https://developer.github.com/v3/repos/deployments/#create-a-deployment-status
5+
It is a small wrapper for your workflows to use the Github Deployment Status API https://docs.github.com/en/rest/reference/repos#deployments
6+
7+
Read more on the deployment event on github actions https://docs.github.com/en/actions/reference/events-that-trigger-workflows#deployment
68

79
## Usage
810

9-
For example use this at the end of your job like this:
11+
For example like this
12+
```
13+
on: deployment
14+
name: Deploy
15+
jobs:
16+
deploy:
17+
name: Deploy event
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Set deploystatus in_progress
21+
uses: unacast/actions-github-deployment-status@[version]
22+
with:
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
status: in_progress
25+
26+
... <Do your deploy stuff>
27+
- name: Set an environment
28+
run: |
29+
echo '::set-env name=DEPLOY_ENVIRONMENT::http://halloi.lol'
1030
31+
- name: Update result to Deployment API
32+
if: always()
33+
uses: unacast/actions-github-deployment-status@[version]
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
status: ${{ job.status }}
37+
description: "Deployed to some magic"
38+
environment_url: '${{ DEPLOY_ENVIRONMENT }}'
1139
```
12-
- name: update deploy status
13-
if: always()
14-
uses: unacast/actions-github-deployment-status@[version]
15-
with:
16-
github_token: ${{ secrets.GITHUB_TOKEN }}
17-
status: ${{ job.status }}
18-
description: "The description to create. Restricted to 140 chars"
40+
41+
### Inputs
42+
The action has the following inputs (see in action.yml)
1943
```
44+
github_token:
45+
description: 'The GITHUB_TOKEN secret'
46+
required: true
47+
status:
48+
description: 'The status to create. Can be one of error, failure, inactive, in_progress, queued, pending, or success'
49+
required: true
50+
description:
51+
description: 'The description to create. Restricted to 140 chars'
52+
required: false
53+
default: ""
54+
environment_url:
55+
description: 'Sets the URL for accessing your environment'
56+
required: false
57+
default: ""
58+
auto_inactive:
59+
description: "Adds a new inactive status to all prior non-transient, non-production environment deployments with the same repository and environment name as the created status's deployment. An inactive status is only added to deployments that had a success state."
60+
required: false
61+
default: true
62+
```
63+
64+
## FAQ
65+
Q: Can I use this in workflows that listens to events other than the deployment event?
66+
A: No. This is tailored to the deployment event.

0 commit comments

Comments
 (0)