Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Zhang (张涛) committed Jan 16, 2024
1 parent 01ad262 commit 4700d7b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
25 changes: 14 additions & 11 deletions packages/canyon-backend/src/adapter/gitlab.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,24 +149,27 @@ export const getFileInfo = async (
)
.then(({ data }) => data);
};

// console.log(process.env.PRIVATE_TOKEN)
export const getCommits = async (
{ projectID, commitShas }: { projectID: string; commitShas: string[] },
token: string,
) => {
return await Promise.all(
commitShas.map((commitSha) =>
axios
.get<Commit>(
`${GITLAB_URL}/api/v4/projects/${projectID}/repository/commits/${commitSha}`,
{
headers: {
// Authorization: `Bearer ${token}`,
'private-token': process.env.PRIVATE_TOKEN,
{
console.log(commitSha)
return axios
.get<Commit>(
`${GITLAB_URL}/api/v4/projects/${projectID}/repository/commits/${commitSha}`,
{
headers: {
// Authorization: `Bearer ${token}`,
'private-token': process.env.PRIVATE_TOKEN,
},
},
},
)
.then(({ data }) => data),
)
.then(({ data }) => data)
},
),
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { PrismaService } from '../../prisma/prisma.service';
import { calculateCoverageOverviewByConditionFilter } from '../../utils/summary';
import process from 'process';
// import process from 'process';
import { getCommits } from '../../adapter/gitlab.adapter';
// import { getProjectByID } from '../adapter/gitlab.adapter';
@Injectable()
Expand Down

0 comments on commit 4700d7b

Please sign in to comment.