Skip to content

Commit

Permalink
Attempt to use the github_token
Browse files Browse the repository at this point in the history
  • Loading branch information
captainbrosset committed Sep 1, 2023
1 parent 2f59b76 commit 46e2b18
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/report-references-to-old-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async function findReferencesToEdgeVersionsOlderThanRelease() {

async function createIssue(title, content) {
// Create a new issue.
const octokit = github.getOctokit(github.token);
const octokit = github.getOctokit(process.env.GITHUB_TOKEN);

const {data: issue} = await octokit.rest.issues.create({
owner: "MicrosoftDocs",
Expand All @@ -124,6 +124,11 @@ findReferencesToEdgeVersionsOlderThanRelease().then(matches => {
console.log('Outdated Edge version references found:');
console.log(report);

if (!process.env.GITHUB_TOKEN) {
console.log('No GITHUB_TOKEN environment variable found, skipping issue creation.');
return;
}

return createIssue('Outdated Edge version references found', report).then(issue => {
console.log(`Created issue ${issue.number} at ${issue.html_url}`);
});
Expand Down

0 comments on commit 46e2b18

Please sign in to comment.