Skip to content

Commit

Permalink
👌 First attempt at layerCI GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy-anderson committed Apr 28, 2021
1 parent 9969a75 commit 1d8f4a0
Show file tree
Hide file tree
Showing 329 changed files with 70,985 additions and 0 deletions.
21 changes: 21 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'LayerCI-Webhook'
description: 'Manually start a pipeline in LayerCI'
inputs:
apiKey:
description: 'LayerCI API Key'
required: true
apiExtra:
description: :'some extra data exposed as API_EXTRA variable'
required: true
buttons:
description: 'wether to automatically accept any BUTTON instructions in the job'
required: true
branch:
description: 'branch'
required: true
ref:
description: 'SHA of commit to checkout'
required: true
runs:
using: 'node12'
main: 'index.js'
35 changes: 35 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const core = require('@actions/core');

try {
const apiKey = core.getInput('apiKey')
const apiExtra = core.getInput('apiExtra')
const buttons = core.getInput('buttons')
const branch = core.getInput('branch')
const ref = core.getInput('ref')

fetch(
'https://layerci.com/api/v1/run/repo_name?layertoken='+apiKey,
{
method: "POST",
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
'branch': branch,
'ref': ref,
'accept_buttons': buttons,
'extra': apiExtra,
}),
}
).then(res => res.json()).then(json => console.log(json))


} catch (error) {
core.setFailed(`Action failed with error ${error}`);
}






9 changes: 9 additions & 0 deletions node_modules/@actions/core/LICENSE.md

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

202 changes: 202 additions & 0 deletions node_modules/@actions/core/README.md

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

16 changes: 16 additions & 0 deletions node_modules/@actions/core/lib/command.d.ts

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

79 changes: 79 additions & 0 deletions node_modules/@actions/core/lib/command.js

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

1 change: 1 addition & 0 deletions node_modules/@actions/core/lib/command.js.map

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

Loading

0 comments on commit 1d8f4a0

Please sign in to comment.