Skip to content

Commit efd7f1e

Browse files
committed
Update code-pushup with refs fix
1 parent f45c4e2 commit efd7f1e

File tree

6 files changed

+120
-91
lines changed

6 files changed

+120
-91
lines changed

dist/index.js

Lines changed: 57 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 45 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,19 @@
8080
"@actions/core": "^1.11.1",
8181
"@actions/exec": "^1.1.1",
8282
"@actions/github": "^6.0.0",
83-
"@code-pushup/ci": "^0.63.0",
84-
"@code-pushup/models": "^0.63.0",
85-
"@code-pushup/utils": "^0.63.0",
83+
"@code-pushup/ci": "^0.64.0",
84+
"@code-pushup/models": "^0.64.0",
85+
"@code-pushup/utils": "^0.64.0",
8686
"better-enums": "^0.2.2",
8787
"fast-glob": "^3.3.3",
8888
"simple-git": "^3.27.0",
8989
"yaml": "^2.7.0"
9090
},
9191
"devDependencies": {
92-
"@code-pushup/cli": "^0.63.0",
93-
"@code-pushup/coverage-plugin": "^0.63.0",
94-
"@code-pushup/eslint-plugin": "^0.63.0",
95-
"@code-pushup/js-packages-plugin": "^0.63.0",
92+
"@code-pushup/cli": "^0.64.0",
93+
"@code-pushup/coverage-plugin": "^0.64.0",
94+
"@code-pushup/eslint-plugin": "^0.64.0",
95+
"@code-pushup/js-packages-plugin": "^0.64.0",
9696
"@code-pushup/portal-client": "^0.11.0",
9797
"@types/jest": "^29.5.14",
9898
"@types/node": "^22.13.5",

src/api.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import type { ArtifactClient } from '@actions/artifact'
22
import * as core from '@actions/core'
33
import * as github from '@actions/github'
4-
import type { Comment, GitRefs, ProviderAPIClient } from '@code-pushup/ci'
4+
import type { Comment, ProviderAPIClient } from '@code-pushup/ci'
55
import type { components } from '@octokit/openapi-types'
66
import { downloadReportArtifact } from './artifact'
7+
import type { GitHubRefs } from './refs'
78

89
export class GitHubApiClient implements ProviderAPIClient {
910
readonly maxCommentChars = 65_536
@@ -12,7 +13,7 @@ export class GitHubApiClient implements ProviderAPIClient {
1213

1314
constructor(
1415
private readonly token: string,
15-
private readonly refs: GitRefs,
16+
private readonly refs: GitHubRefs,
1617
private readonly artifact: ArtifactClient,
1718
getOctokit: typeof github.getOctokit
1819
) {

src/refs.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import * as github from '@actions/github'
22
import type { WebhookPayload } from '@actions/github/lib/interfaces'
3-
import type { GitBranch, GitRefs } from '@code-pushup/ci'
3+
import type { GitBranch } from '@code-pushup/ci'
44
import type { components } from '@octokit/openapi-types'
55

6-
export function parseGitRefs(): GitRefs {
6+
export type GitHubRefs = {
7+
head: GitBranch
8+
base?: GitBranch
9+
}
10+
11+
export function parseGitRefs(): GitHubRefs {
712
if (isPullRequest(github.context.payload.pull_request)) {
813
const { head, base } = github.context.payload.pull_request
914
return { head: parseBranchRef(head), base: parseBranchRef(base) }

0 commit comments

Comments
 (0)