docs: Changelogs plugin updated without accessToken
This commit is contained in:
parent
71f314b9c9
commit
d695f4a985
@ -2,12 +2,11 @@ const fs = require('fs');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
async function fetchData(siteConfig) {
|
async function fetchData(siteConfig) {
|
||||||
const accessToken = siteConfig.customFields.githubAccessToken;
|
const owner = siteConfig.organizationName;
|
||||||
const owner = siteConfig.customFields.organizationName;
|
const repo = siteConfig.projectName;
|
||||||
const repo = siteConfig.customFields.projectName;
|
|
||||||
const apiUrl = `https://api.github.com/repos/${owner}/${repo}/releases`;
|
const apiUrl = `https://api.github.com/repos/${owner}/${repo}/releases`;
|
||||||
|
|
||||||
const outputDirectory = path.join(__dirname, '../../docs/quickstart/changelogs-v2');
|
const outputDirectory = path.join(__dirname, '../../docs/guides/changelogs');
|
||||||
|
|
||||||
if (!fs.existsSync(outputDirectory)) {
|
if (!fs.existsSync(outputDirectory)) {
|
||||||
fs.mkdirSync(outputDirectory);
|
fs.mkdirSync(outputDirectory);
|
||||||
@ -29,7 +28,6 @@ async function fetchData(siteConfig) {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Accept': 'application/vnd.github.v3+json',
|
'Accept': 'application/vnd.github.v3+json',
|
||||||
'Authorization': `Bearer ${accessToken}`,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -52,8 +50,6 @@ async function fetchData(siteConfig) {
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Accept': 'application/vnd.github+json',
|
'Accept': 'application/vnd.github+json',
|
||||||
'Authorization': `Bearer ${accessToken}`,
|
|
||||||
'X-GitHub-Api-Version': '2022-11-28',
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -100,7 +96,7 @@ async function fetchData(siteConfig) {
|
|||||||
|
|
||||||
// Create _category_.json file
|
// Create _category_.json file
|
||||||
const categoryContent = {
|
const categoryContent = {
|
||||||
label: 'Changelog-v2',
|
label: 'Changelogs',
|
||||||
position: 5,
|
position: 5,
|
||||||
link: {
|
link: {
|
||||||
type: 'generated-index',
|
type: 'generated-index',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user