Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 104 additions & 100 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4472,46 +4472,6 @@ CacheableRequest.CacheError = class extends Error {
module.exports = CacheableRequest;


/***/ }),

/***/ 5204:
/***/ ((module) => {

"use strict";


// We define these manually to ensure they're always copied
// even if they would move up the prototype chain
// https://nodejs.org/api/http.html#http_class_http_incomingmessage
const knownProps = [
'destroy',
'setTimeout',
'socket',
'headers',
'trailers',
'rawHeaders',
'statusCode',
'httpVersion',
'httpVersionMinor',
'httpVersionMajor',
'rawTrailers',
'statusMessage'
];

module.exports = (fromStream, toStream) => {
const fromProps = new Set(Object.keys(fromStream).concat(knownProps));

for (const prop of fromProps) {
// Don't overwrite existing properties
if (prop in toStream) {
continue;
}

toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop];
}
};


/***/ }),

/***/ 6358:
Expand All @@ -4521,7 +4481,7 @@ module.exports = (fromStream, toStream) => {


const PassThrough = (__nccwpck_require__(2203).PassThrough);
const mimicResponse = __nccwpck_require__(5204);
const mimicResponse = __nccwpck_require__(9991);

const cloneResponse = response => {
if (!(response && response.pipe)) {
Expand All @@ -4546,7 +4506,7 @@ module.exports = cloneResponse;

const {Transform, PassThrough} = __nccwpck_require__(2203);
const zlib = __nccwpck_require__(3106);
const mimicResponse = __nccwpck_require__(9991);
const mimicResponse = __nccwpck_require__(9382);

module.exports = response => {
const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase();
Expand Down Expand Up @@ -4603,6 +4563,91 @@ module.exports = response => {
};


/***/ }),

/***/ 9382:
/***/ ((module) => {

"use strict";


// We define these manually to ensure they're always copied
// even if they would move up the prototype chain
// https://nodejs.org/api/http.html#http_class_http_incomingmessage
const knownProperties = [
'aborted',
'complete',
'headers',
'httpVersion',
'httpVersionMinor',
'httpVersionMajor',
'method',
'rawHeaders',
'rawTrailers',
'setTimeout',
'socket',
'statusCode',
'statusMessage',
'trailers',
'url'
];

module.exports = (fromStream, toStream) => {
if (toStream._readableState.autoDestroy) {
throw new Error('The second stream must have the `autoDestroy` option set to `false`');
}

const fromProperties = new Set(Object.keys(fromStream).concat(knownProperties));

const properties = {};

for (const property of fromProperties) {
// Don't overwrite existing properties.
if (property in toStream) {
continue;
}

properties[property] = {
get() {
const value = fromStream[property];
const isFunction = typeof value === 'function';

return isFunction ? value.bind(fromStream) : value;
},
set(value) {
fromStream[property] = value;
},
enumerable: true,
configurable: false
};
}

Object.defineProperties(toStream, properties);

fromStream.once('aborted', () => {
toStream.destroy();

toStream.emit('aborted');
});

fromStream.once('close', () => {
if (fromStream.complete) {
if (toStream.readable) {
toStream.once('end', () => {
toStream.emit('close');
});
} else {
toStream.emit('close');
}
} else {
toStream.emit('close');
}
});

return toStream;
};


/***/ }),

/***/ 2114:
Expand Down Expand Up @@ -14658,77 +14703,32 @@ module.exports = object => {
// We define these manually to ensure they're always copied
// even if they would move up the prototype chain
// https://nodejs.org/api/http.html#http_class_http_incomingmessage
const knownProperties = [
'aborted',
'complete',
const knownProps = [
'destroy',
'setTimeout',
'socket',
'headers',
'trailers',
'rawHeaders',
'statusCode',
'httpVersion',
'httpVersionMinor',
'httpVersionMajor',
'method',
'rawHeaders',
'rawTrailers',
'setTimeout',
'socket',
'statusCode',
'statusMessage',
'trailers',
'url'
'statusMessage'
];

module.exports = (fromStream, toStream) => {
if (toStream._readableState.autoDestroy) {
throw new Error('The second stream must have the `autoDestroy` option set to `false`');
}

const fromProperties = new Set(Object.keys(fromStream).concat(knownProperties));

const properties = {};
const fromProps = new Set(Object.keys(fromStream).concat(knownProps));

for (const property of fromProperties) {
// Don't overwrite existing properties.
if (property in toStream) {
for (const prop of fromProps) {
// Don't overwrite existing properties
if (prop in toStream) {
continue;
}

properties[property] = {
get() {
const value = fromStream[property];
const isFunction = typeof value === 'function';

return isFunction ? value.bind(fromStream) : value;
},
set(value) {
fromStream[property] = value;
},
enumerable: true,
configurable: false
};
toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop];
}

Object.defineProperties(toStream, properties);

fromStream.once('aborted', () => {
toStream.destroy();

toStream.emit('aborted');
});

fromStream.once('close', () => {
if (fromStream.complete) {
if (toStream.readable) {
toStream.once('end', () => {
toStream.emit('close');
});
} else {
toStream.emit('close');
}
} else {
toStream.emit('close');
}
});

return toStream;
};


Expand Down Expand Up @@ -38004,6 +38004,10 @@ function postMessage() {
function post(body) {
return __awaiter(this, void 0, void 0, function* () {
const url = core.getInput('url');
if (!url) {
throw new Error('The "url" input is empty. Check that the secret is configured and passed correctly.\n' +
'Note: repository secrets are unavailable to workflows triggered by fork pull requests.');
}
const rsp = yield got_1.default.post(url, {
headers: {
'Content-Type': 'application/json'
Expand Down
6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ async function postMessage(): Promise<string> {

async function post(body: Message): Promise<string> {
const url: string = core.getInput('url')
if (!url) {
throw new Error(
'The "url" input is empty. Check that the secret is configured and passed correctly.\n' +
'Note: repository secrets are unavailable to workflows triggered by fork pull requests.'
)
}
const rsp = await got.post(url, {
headers: {
'Content-Type': 'application/json'
Expand Down