-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👌 First attempt at layerCI GH action
- Loading branch information
1 parent
9969a75
commit 1d8f4a0
Showing
329 changed files
with
70,985 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,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' |
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,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}`); | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.