-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d0b67db
Showing
6 changed files
with
406 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM node:lts-alpine | ||
RUN apk add --no-cache ca-certificates | ||
COPY . /usr/app | ||
WORKDIR /usr/app | ||
RUN npm install | ||
ENTRYPOINT ["node", "index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: 'Deliverybot Deployment Status' | ||
description: 'Set the status of a deployment' | ||
author: 'deliverybot' | ||
inputs: | ||
state: | ||
description: 'Deployment status to set the action as' | ||
default: 'pending' | ||
token: | ||
description: 'Github repository token' | ||
log-url: | ||
description: 'Log url location' | ||
description: | ||
description: 'Descriptive message about the deployment state' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const core = require("@actions/core"); | ||
const github = require("@actions/github"); | ||
|
||
async function run() { | ||
try { | ||
const token = core.getInput("token", {required: true}); | ||
const state = core.getInput("state", {required: true}); | ||
const log_url = core.getInput("log-url", {required: false}); | ||
const description = core.getInput("description", {required: false}); | ||
|
||
const client = new github.GitHub(token); | ||
const context = github.context; | ||
|
||
await client.repos.createDeploymentStatus({ | ||
...context.repo, | ||
deployment_id: context.payload.deployment.id, | ||
state, | ||
log_url, | ||
description, | ||
}); | ||
} catch (error) { | ||
core.error(error); | ||
core.setFailed(error.message); | ||
} | ||
} | ||
|
||
run(); |
Oops, something went wrong.