change octokit init to env variable

This commit is contained in:
jpaul 2023-11-13 05:24:52 +01:00
parent e187800569
commit 5bc77ce65e
3 changed files with 3 additions and 3 deletions

2
dist/cleanup/index.js generated vendored
View File

@ -74911,7 +74911,7 @@ function createPRComment(content) {
}
const context = github.context;
try {
yield github.getOctokit(getGitHubToken()).rest.issues.createComment(Object.assign(Object.assign({}, context.repo), { issue_number: (_a = context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.number, body: content }));
yield new rest_1.Octokit({ auth: process.env.GITHUB_TOKEN }).rest.issues.createComment(Object.assign(Object.assign({}, context.repo), { issue_number: (_a = context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.number, body: content }));
}
catch (err) {
core.error(`Failed to create pull request comment. Please make sure this job has 'write' permissions for the 'pull-requests' scope (see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions)? Internal error: ${err}`);

2
dist/main/index.js generated vendored
View File

@ -75908,7 +75908,7 @@ function createPRComment(content) {
}
const context = github.context;
try {
yield github.getOctokit(getGitHubToken()).rest.issues.createComment(Object.assign(Object.assign({}, context.repo), { issue_number: (_a = context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.number, body: content }));
yield new rest_1.Octokit({ auth: process.env.GITHUB_TOKEN }).rest.issues.createComment(Object.assign(Object.assign({}, context.repo), { issue_number: (_a = context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.number, body: content }));
}
catch (err) {
core.error(`Failed to create pull request comment. Please make sure this job has 'write' permissions for the 'pull-requests' scope (see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions)? Internal error: ${err}`);

View File

@ -169,7 +169,7 @@ export async function createPRComment(content: string): Promise<void> {
}
const context = github.context
try {
await github.getOctokit(getGitHubToken()).rest.issues.createComment({
await new Octokit({ auth: process.env.GITHUB_TOKEN }).rest.issues.createComment({
...context.repo,
issue_number: context.payload.pull_request?.number as number,
body: content