Add backwards compatibility

This commit is contained in:
Joel Male 2020-08-27 18:25:12 +10:00
parent 01d242f5b1
commit 0c4ba5b174
9 changed files with 8 additions and 8 deletions

4
dist/index.js vendored
View File

@ -86,9 +86,9 @@ function run() {
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var url, headers, body; var url, headers, body;
return __generator(this, function (_a) { return __generator(this, function (_a) {
url = core.getInput('url') ? core.getInput('url') : (process.env.url ? process.env.url : ''); url = core.getInput('url') ? core.getInput('url') : (process.env.WEBHOOK_URL ? process.env.WEBHOOK_URL : '');
headers = core.getInput('headers') ? core.getInput('headers') : (process.env.headers ? process.env.headers : null); headers = core.getInput('headers') ? core.getInput('headers') : (process.env.headers ? process.env.headers : null);
body = core.getInput('body') ? core.getInput('body') : (process.env.body ? process.env.body : null); body = core.getInput('body') ? core.getInput('body') : (process.env.data ? process.env.data : null);
if (!url) { if (!url) {
core.setFailed('A url is required to run this action.'); core.setFailed('A url is required to run this action.');
return [2]; return [2];

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/main.js vendored
View File

@ -42,9 +42,9 @@ function run() {
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var url, headers, body; var url, headers, body;
return __generator(this, function (_a) { return __generator(this, function (_a) {
url = core.getInput('url') ? core.getInput('url') : (process.env.url ? process.env.url : ''); url = core.getInput('url') ? core.getInput('url') : (process.env.WEBHOOK_URL ? process.env.WEBHOOK_URL : '');
headers = core.getInput('headers') ? core.getInput('headers') : (process.env.headers ? process.env.headers : null); headers = core.getInput('headers') ? core.getInput('headers') : (process.env.headers ? process.env.headers : null);
body = core.getInput('body') ? core.getInput('body') : (process.env.body ? process.env.body : null); body = core.getInput('body') ? core.getInput('body') : (process.env.data ? process.env.data : null);
if (!url) { if (!url) {
core.setFailed('A url is required to run this action.'); core.setFailed('A url is required to run this action.');
return [2]; return [2];

2
dist/main.js.map vendored
View File

@ -1 +1 @@
{"version":3,"file":"main.js","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CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAE1G,IAAI,CAAC,GAAG,EAAE;gBAER,IAAI,CAAC,SAAS,CAAC,uCAAuC,CAAC,CAAC;gBACxD,WAAO;aACR;YAGD,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,IAAI,CAAC,IAAI,CAAC,2BAAyB,GAAG,CAAC,MAAQ,CAAC,CAAC;gBAEjD,IAAI,CAAC,IAAI,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"}

Binary file not shown.

Binary file not shown.

View File

@ -2,9 +2,9 @@ import * as core from '@actions/core';
import { http } from './http'; import { http } from './http';
async function run() { async function run() {
const url = core.getInput('url') ? core.getInput('url') : (process.env.url ? process.env.url : ''); const url = core.getInput('url') ? core.getInput('url') : (process.env.WEBHOOK_URL ? process.env.WEBHOOK_URL : '');
const headers = core.getInput('headers') ? core.getInput('headers') : (process.env.headers ? process.env.headers : null); const headers = core.getInput('headers') ? core.getInput('headers') : (process.env.headers ? process.env.headers : null);
const body = core.getInput('body') ? core.getInput('body') : (process.env.body ? process.env.body : null); const body = core.getInput('body') ? core.getInput('body') : (process.env.data ? process.env.data : null);
if (!url) { if (!url) {
// validate a url // validate a url