mirror of
https://github.com/joelwmale/webhook-action.git
synced 2024-08-25 08:08:00 +00:00
* v2.0.0 (#12) - Convert project to Javascript/Typescript - Allow custom headers to be passed in (optional) - Allow body to be optional * Update action.yml * Update action.yml * Add support for environment variables (fixed #17) * Add support for header as environment variables * Run build and package Co-authored-by: Joel Male <joel@joelmale.com>
This commit is contained in:
parent
e22e83d67d
commit
517289c047
10
dist/index.js
vendored
10
dist/index.js
vendored
@ -2129,13 +2129,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var core = __webpack_require__(186);
|
||||
var http_1 = __webpack_require__(319);
|
||||
function run() {
|
||||
var _a, _b;
|
||||
var _a, _b, _c, _d, _e;
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var url, headers, body;
|
||||
return __generator(this, function (_c) {
|
||||
url = core.getInput('url');
|
||||
headers = (_a = core.getInput('headers')) !== null && _a !== void 0 ? _a : null;
|
||||
body = (_b = core.getInput('body')) !== null && _b !== void 0 ? _b : null;
|
||||
return __generator(this, function (_f) {
|
||||
url = (_a = core.getInput('url')) !== null && _a !== void 0 ? _a : process.env.WEBHOOK_URL;
|
||||
headers = (_c = (_b = core.getInput('headers')) !== null && _b !== void 0 ? _b : process.env.HEADERS) !== null && _c !== void 0 ? _c : null;
|
||||
body = (_e = (_d = core.getInput('body')) !== null && _d !== void 0 ? _d : process.env.data) !== null && _e !== void 0 ? _e : null;
|
||||
core.info("Sending webhook request to " + url);
|
||||
core.debug((new Date()).toTimeString());
|
||||
http_1.http.make(url, headers, body)
|
||||
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
10
dist/main.js
vendored
10
dist/main.js
vendored
@ -39,13 +39,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var core = require("@actions/core");
|
||||
var http_1 = require("./http");
|
||||
function run() {
|
||||
var _a, _b;
|
||||
var _a, _b, _c, _d, _e;
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var url, headers, body;
|
||||
return __generator(this, function (_c) {
|
||||
url = core.getInput('url');
|
||||
headers = (_a = core.getInput('headers')) !== null && _a !== void 0 ? _a : null;
|
||||
body = (_b = core.getInput('body')) !== null && _b !== void 0 ? _b : null;
|
||||
return __generator(this, function (_f) {
|
||||
url = (_a = core.getInput('url')) !== null && _a !== void 0 ? _a : process.env.WEBHOOK_URL;
|
||||
headers = (_c = (_b = core.getInput('headers')) !== null && _b !== void 0 ? _b : process.env.HEADERS) !== null && _c !== void 0 ? _c : null;
|
||||
body = (_e = (_d = core.getInput('body')) !== null && _d !== void 0 ? _d : process.env.data) !== null && _e !== void 0 ? _e : null;
|
||||
core.info("Sending webhook request to " + url);
|
||||
core.debug((new Date()).toTimeString());
|
||||
http_1.http.make(url, headers, body)
|
||||
|
2
dist/main.js.map
vendored
2
dist/main.js.map
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAsC;AACtC,+BAA8B;AAE9B,SAAe,GAAG;;;;;YACR,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC3B,OAAO,SAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,mCAAI,IAAI,CAAC;YAC3C,IAAI,SAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;YAG3C,IAAI,CAAC,IAAI,CAAC,gCAA8B,GAAK,CAAC,CAAC;YAG/C,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;YAGxC,WAAI,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC;iBAC1B,IAAI,CAAC,UAAC,GAAG;gBAER,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;gBAEzC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I,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;YACzC,CAAC,CAAC;iBACD,KAAK,CAAC,UAAC,GAAG;gBAET,IAAI,CAAC,SAAS,CAAC,2BAAyB,GAAG,CAAC,MAAQ,CAAC,CAAC;YACxD,CAAC,CAAC,CAAC;;;;CACR;AAED,GAAG,EAAE,CAAC"}
|
BIN
node_modules/@vercel/ncc/dist/ncc/cli.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/cli.js.cache
generated
vendored
Binary file not shown.
BIN
node_modules/@vercel/ncc/dist/ncc/index.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/index.js.cache
generated
vendored
Binary file not shown.
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache
generated
vendored
Binary file not shown.
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache
generated
vendored
Binary file not shown.
@ -2,9 +2,9 @@ import * as core from '@actions/core';
|
||||
import { http } from './http';
|
||||
|
||||
async function run() {
|
||||
const url = core.getInput('url');
|
||||
const headers = core.getInput('headers') ?? null;
|
||||
const body = core.getInput('body') ?? null;
|
||||
const url = core.getInput('url') ?? process.env.WEBHOOK_URL;
|
||||
const headers = core.getInput('headers') ?? process.env.HEADERS ?? null;
|
||||
const body = core.getInput('body') ?? process.env.data ?? null;
|
||||
|
||||
// initial info
|
||||
core.info(`Sending webhook request to ${url}`);
|
||||
@ -28,4 +28,4 @@ async function run() {
|
||||
});
|
||||
}
|
||||
|
||||
run();
|
||||
run();
|
||||
|
Loading…
Reference in New Issue
Block a user