mirror of
https://git.mirrors.martin98.com/https://github.com/cyberman54/curl
synced 2025-11-19 00:41:07 +08:00
17 lines
454 B
TypeScript
17 lines
454 B
TypeScript
import { INPUT_LOG_RESPONSE } from "./requestconf";
|
|
import * as core from "@actions/core";
|
|
import * as util from "./util";
|
|
import { AxiosResponse } from "axios";
|
|
|
|
const setOutput = (res: void | AxiosResponse<any>) => {
|
|
if (!res) {
|
|
throw new Error("No response from request");
|
|
}
|
|
if (INPUT_LOG_RESPONSE) {
|
|
core.info(`Response: ${util.buildOutput(res)}`);
|
|
}
|
|
core.setOutput("response", util.buildOutput(res));
|
|
};
|
|
|
|
export default setOutput;
|