Skip to content

Commit

Permalink
Still getting error... Add debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
underrobyn committed Jan 1, 2024
1 parent 67c0d95 commit 396b416
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/overrides.dev.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "dependabot-fail-task-dev",
"version": "0.1.0.1",
"version": "0.2.0.0",
"name": "Dependabot Fail Task (Dev)",
"description": "Development version of Dependabot fail task"
}
13 changes: 8 additions & 5 deletions src/task/common/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as tl from 'azure-pipelines-task-lib/task';
import {Octokit} from "@octokit/core";
import {paginateRest} from "@octokit/plugin-paginate-rest";
import {createTokenAuth} from "@octokit/auth-token";
import fetch from "node-fetch";
import * as nodeFetch from "node-fetch";

export interface DependabotAlert {
security_advisory: {
Expand All @@ -19,16 +19,19 @@ export interface DependabotAlert {
async function getGitHubInstance() {
tl.debug('Fetching GitHub instance');

const OktokitPaginate = Octokit.plugin(paginateRest);
console.log("Type of native fetch:", typeof fetch);
console.log("Type of node-fetch:", typeof nodeFetch);

const OctokitPaginate = Octokit.plugin(paginateRest);

const auth = createTokenAuth(getGitHubToken());
const authentication = await auth();

return new OktokitPaginate({
return new OctokitPaginate({
auth: authentication.token,
request: {
fetch: fetch,
},
fetch: nodeFetch,
}
});
}

Expand Down

0 comments on commit 396b416

Please sign in to comment.