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:
+9
-1
@@ -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
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user