mirror of
https://github.com/joelwmale/webhook-action.git
synced 2026-09-01 13:50:45 +08: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:
co-authored by
Joel Male
parent
e22e83d67d
commit
517289c047
Vendored
+5
-5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user