Skip to content

Commit aa48acc

Browse files
authored
Use Authorization header instead of access_token for Github call (#5554)
1 parent 6f66b4b commit aa48acc

File tree

1 file changed

+7
-3
lines changed
  • repo-scripts/changelog-generator

1 file changed

+7
-3
lines changed

repo-scripts/changelog-generator/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,19 @@ const changelogFunctions: ChangelogFunctions = {
8989
}
9090
};
9191

92-
const fixedIssueRegex = /(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved) [^\s]*(#|issues\/)([\d]+)/i;
92+
const fixedIssueRegex =
93+
/(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved) [^\s]*(#|issues\/)([\d]+)/i;
9394
async function getFixedIssueLink(
9495
prNumber: number,
9596
repo: string
9697
): Promise<string> {
9798
const { body }: { body: string } = await fetch(
98-
`https://api.github.com/repos/${repo}/pulls/${prNumber}?access_token=${process.env.GITHUB_TOKEN}`,
99+
`https://api.github.com/repos/${repo}/pulls/${prNumber}`,
99100
{
100-
method: 'GET'
101+
method: 'GET',
102+
headers: {
103+
'Authorization': `Bearer ${process.env.GITHUB_TOKEN}`
104+
}
101105
}
102106
).then(data => data.json());
103107

0 commit comments

Comments
 (0)