Skip to content

Commit 4eea3e0

Browse files
committed
add auto_merge input parameter
1 parent 9054e90 commit 4eea3e0

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ A GitHub action to create [Deployments](https://developer.github.com/v3/repos/de
44

55
## Action inputs
66

7-
| name | description |
8-
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
9-
| `initial_status` | (Optional) Initial status for the deployment. Must be one of the [accepted strings](https://developer.github.com/v3/repos/deployments/#create-a-deployment-status) |
10-
| `token` | GitHub token |
11-
| `target_url` | (Optional) The target URL. This should be the URL of the app once deployed |
12-
| `description` | (Optional) A description to give the environment |
7+
| name | description |
8+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9+
| `initial_status` | (Optional) Initial status for the deployment. Must be one of the [accepted strings](https://developer.github.com/v3/repos/deployments/#create-a-deployment-status) |
10+
| `token` | GitHub token |
11+
| `target_url` | (Optional) The target URL. This should be the URL of the app once deployed |
12+
| `description` | (Optional) A description to give the environment |
13+
| `auto_merge` | (Optional - default is `false`) Whether to attempt to auto-merge the default branch into the branch that the action is running on if set to `"true"`. More details in the [GitHub deployments API](https://developer.github.com/v3/repos/deployments/#parameters-1). Warning - setting this to `"true"` has caused this action to [fail in some cases](https://github.com/chrnorm/deployment-action/issues/1) |
1314

1415
## Action outputs
1516

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ async function run() {
2424
(core.getInput("initial_status", {
2525
required: false
2626
}) as DeploymentState) || "pending";
27+
const autoMergeStringInput = core.getInput("auto_merge", {
28+
required: false
29+
});
30+
31+
const auto_merge: boolean = autoMergeStringInput === "true";
2732

2833
const client = new github.GitHub(token);
2934

@@ -34,6 +39,7 @@ async function run() {
3439
required_contexts: [],
3540
environment,
3641
transient_environment: true,
42+
auto_merge,
3743
description
3844
});
3945

0 commit comments

Comments
 (0)