2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

chore(ci): fixed release notification action; (#6064)

This commit is contained in:
Dmitriy Mozgovoy
2023-11-09 00:47:06 +02:00
committed by GitHub
parent 7144f10dc5
commit 7009715369
4 changed files with 36 additions and 7 deletions
+9 -1
View File
@@ -1,11 +1,19 @@
import axios from '../index.js';
import {colorize} from "./helpers/colorize.js";
const {GITHUB_TOKEN} = process.env;
GITHUB_TOKEN ? console.log(`[GITHUB_TOKEN OK]`) : console.warn(`[GITHUB_TOKEN is not defined]`);
const defaultTransform = axios.defaults.transformRequest;
export default axios.create({
transformRequest: [defaultTransform[0], function (data) {
console.log(colorize()`[${this.method.toUpperCase()}] Request [${new URL(axios.getUri(this)).pathname}]`);
return data;
}],
baseURL: 'https://api.github.com/',
headers: {
Authorization: GITHUB_TOKEN ? `token ${GITHUB_TOKEN}` : null
}
})
});