mirror of
https://github.com/joelwmale/webhook-action.git
synced 2024-08-25 08:08:00 +00:00
Small fixes to action.yml and action output
This commit is contained in:
parent
00f958821e
commit
600d4f061c
19
action.yml
19
action.yml
@ -1,13 +1,18 @@
|
|||||||
name: 'Webhook'
|
name: 'Webhook'
|
||||||
description: 'Wait a designated number of milliseconds'
|
description: 'Send a webhook event to anywhere!'
|
||||||
inputs:
|
inputs:
|
||||||
milliseconds: # id of input
|
url:
|
||||||
description: 'number of milliseconds to wait'
|
description: 'The url to send the webhook event to'
|
||||||
required: true
|
required: true
|
||||||
default: '1000'
|
headers:
|
||||||
|
description: 'Additional headers to send alongside the defaults'
|
||||||
|
required: false
|
||||||
|
body:
|
||||||
|
description: 'The data sent to the webhook'
|
||||||
|
required: false
|
||||||
outputs:
|
outputs:
|
||||||
time: # output will be available to future steps
|
status:
|
||||||
description: 'The message to output'
|
description: 'The status of the webhook event'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'dist/index.js'
|
main: 'dist/main.js'
|
@ -1,7 +1,6 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import { http } from './http';
|
import { http } from './http';
|
||||||
|
|
||||||
// most @actions toolkit packages have async methods
|
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
const url = core.getInput('url');
|
const url = core.getInput('url');
|
||||||
@ -15,13 +14,11 @@ async function run() {
|
|||||||
core.debug((new Date()).toTimeString()); // debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true
|
core.debug((new Date()).toTimeString()); // debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true
|
||||||
|
|
||||||
// make the request
|
// make the request
|
||||||
http.make(url, headers, body).then((res) => console.log('hi'));
|
http.make(url, headers, body)
|
||||||
|
.then((res) => core.setOutput('statusCode', res.status));
|
||||||
|
|
||||||
// debug end
|
// debug end
|
||||||
core.info((new Date()).toTimeString());
|
core.info((new Date()).toTimeString());
|
||||||
|
|
||||||
// output the time it took
|
|
||||||
core.setOutput('time', new Date().toTimeString());
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user