Skip to content

Commit 58d8237

Browse files
committed
Merge branch 'main' into releases/v2
2 parents f616ec2 + 1628139 commit 58d8237

File tree

6 files changed

+41
-41
lines changed

6 files changed

+41
-41
lines changed

README.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,31 @@
22

33
A GitHub action to create [Deployments](https://developer.github.com/v3/repos/deployments/) as part of your GitHub CI workflows.
44

5-
## Breaking changes
5+
## Example usage
66

7-
`v2` of this action removes the `target_url` input and replaces it with the `environment_url` and `log_url` inputs to match GitHub's API. `v2` also standardises on using `kebab-case` rather than `snake_case` for inputs to match GitHub's built-in actions.
7+
```yaml
8+
name: Deploy
9+
10+
on: [push]
11+
12+
jobs:
13+
deploy:
14+
name: Deploy my app
15+
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v1
20+
21+
- uses: chrnorm/deployment-action@v2
22+
name: Create GitHub deployment
23+
id: deployment
24+
with:
25+
token: '${{ github.token }}'
26+
environment-url: http://my-app-url.com
27+
environment: production
28+
# more steps below where you run your deployment scripts inside the same action
29+
```
830

931
## Action inputs
1032

@@ -33,34 +55,8 @@ A GitHub action to create [Deployments](https://developer.github.com/v3/repos/de
3355

3456
| name | description |
3557
| ---------------- | ------------------------------------------------------ |
36-
| `deployment-id` | The ID of the deployment as returned by the GitHub API |
37-
| `deployment-url` | The URL of the created deployment |
38-
39-
## Example usage
40-
41-
```yaml
42-
name: Deploy
43-
44-
on: [push]
45-
46-
jobs:
47-
deploy:
48-
name: Deploy my app
49-
50-
runs-on: ubuntu-latest
51-
52-
steps:
53-
- uses: actions/checkout@v1
54-
55-
- uses: chrnorm/deployment-action@releases/v1
56-
name: Create GitHub deployment
57-
id: deployment
58-
with:
59-
token: '${{ github.token }}'
60-
environment-url: http://my-app-url.com
61-
environment: production
62-
# more steps below where you run your deployment scripts inside the same action
63-
```
58+
| `deployment_id` | The ID of the deployment as returned by the GitHub API |
59+
| `deployment_url` | The URL of the created deployment |
6460

6561
## Notes
6662

@@ -105,7 +101,7 @@ jobs:
105101
token: '${{ github.token }}'
106102
environment-url: http://my-app-url.com
107103
state: 'success'
108-
deployment-id: ${{ steps.deployment.outputs.deployment-id }}
104+
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
109105

110106
- name: Update deployment status (failure)
111107
if: failure()
@@ -114,5 +110,9 @@ jobs:
114110
token: '${{ github.token }}'
115111
environment-url: http://my-app-url.com
116112
state: 'failure'
117-
deployment-id: ${{ steps.deployment.outputs.deployment-id }}
113+
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
118114
```
115+
116+
## Breaking changes
117+
118+
`v2` of this action removes the `target_url` input and replaces it with the `environment_url` and `log_url` inputs to match GitHub's API. `v2` also standardises on using `kebab-case` rather than `snake_case` for inputs to match GitHub's built-in actions.

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ inputs:
6666
description: 'Changes the API base URL for a GitHub Enterprise server.'
6767
required: false
6868
outputs:
69-
deployment-id:
69+
deployment_id:
7070
description: 'The ID of the created deployment'
71-
deployment-url:
71+
deployment_url:
7272
description: 'The URL of the created deployment'
7373

7474
runs:

dist/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ function run() {
102102
throw new Error(deployment.data.message);
103103
}
104104
yield octokit.rest.repos.createDeploymentStatus(Object.assign(Object.assign({}, context.repo), { deployment_id: deployment.data.id, description, state: initialStatus, log_url: logUrl, environment_url: environmentUrl, auto_inactive: autoInactive }));
105-
core.setOutput('deployment-id', deployment.data.id.toString());
106-
core.setOutput('deployment-url', deployment.data.url);
105+
core.setOutput('deployment_id', deployment.data.id.toString());
106+
core.setOutput('deployment_url', deployment.data.url);
107107
}
108108
catch (error) {
109109
core.error(error);

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ function run() {
9595
throw new Error(deployment.data.message);
9696
}
9797
yield octokit.rest.repos.createDeploymentStatus(Object.assign(Object.assign({}, context.repo), { deployment_id: deployment.data.id, description, state: initialStatus, log_url: logUrl, environment_url: environmentUrl, auto_inactive: autoInactive }));
98-
core.setOutput('deployment-id', deployment.data.id.toString());
99-
core.setOutput('deployment-url', deployment.data.url);
98+
core.setOutput('deployment_id', deployment.data.id.toString());
99+
core.setOutput('deployment_url', deployment.data.url);
100100
}
101101
catch (error) {
102102
core.error(error);

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ async function run(): Promise<void> {
104104
auto_inactive: autoInactive
105105
})
106106

107-
core.setOutput('deployment-id', deployment.data.id.toString())
108-
core.setOutput('deployment-url', deployment.data.url)
107+
core.setOutput('deployment_id', deployment.data.id.toString())
108+
core.setOutput('deployment_url', deployment.data.url)
109109
} catch (error: any) {
110110
core.error(error)
111111
core.setFailed(`Error creating GitHub deployment: ${error.message}`)

0 commit comments

Comments
 (0)