Skip to content

Commit

Permalink
add auto_merge input parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
chrnorm committed Nov 4, 2019
1 parent 9054e90 commit 4eea3e0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ A GitHub action to create [Deployments](https://developer.github.com/v3/repos/de

## Action inputs

| name | description |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `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) |
| `token` | GitHub token |
| `target_url` | (Optional) The target URL. This should be the URL of the app once deployed |
| `description` | (Optional) A description to give the environment |
| name | description |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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) |
| `token` | GitHub token |
| `target_url` | (Optional) The target URL. This should be the URL of the app once deployed |
| `description` | (Optional) A description to give the environment |
| `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) |

## Action outputs

Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ async function run() {
(core.getInput("initial_status", {
required: false
}) as DeploymentState) || "pending";
const autoMergeStringInput = core.getInput("auto_merge", {
required: false
});

const auto_merge: boolean = autoMergeStringInput === "true";

const client = new github.GitHub(token);

Expand All @@ -34,6 +39,7 @@ async function run() {
required_contexts: [],
environment,
transient_environment: true,
auto_merge,
description
});

Expand Down

0 comments on commit 4eea3e0

Please sign in to comment.