Skip to content

Commit aebce29

Browse files
authored
fix(cli): revert to lhci github status context (#249)
1 parent fbb5405 commit aebce29

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

packages/cli/src/upload/upload.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ function buildCommand(yargs) {
8282
type: 'string',
8383
description: 'The LHCI GitHub App token to use to apply a status check.',
8484
},
85+
githubStatusContextSuffix: {
86+
type: 'string',
87+
description: 'The suffix of the GitHub status check context label.',
88+
},
8589
extraHeaders: {
8690
description: '[lhci only] Extra headers to use when making API requests to the LHCI server.',
8791
},
@@ -164,12 +168,13 @@ function getUrlLabelForGithub(rawUrl, options) {
164168
}
165169

166170
/**
167-
*
168171
* @param {string} urlLabel
169172
* @param {LHCI.UploadCommand.Options} options
170173
*/
171174
function getGitHubContext(urlLabel, options) {
172-
const prefix = options.githubAppToken ? 'lhci-app' : 'lhci';
175+
const prefix = options.githubStatusContextSuffix
176+
? `lhci${options.githubStatusContextSuffix}`
177+
: 'lhci';
173178
return `${prefix}/url${urlLabel}`;
174179
}
175180

scripts/ci-dogfood.sh

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ if [[ -n "$LHCI_CANARY_SERVER_URL" ]]; then
2929
fi
3030

3131
# Upload the results to temporary public storage too
32+
export LHCI_GITHUB_STATUS_CONTEXT_SUFFIX="-2"
3233
export LHCI_GITHUB_APP_TOKEN=""
3334
yarn start upload --target=temporary-public-storage
3435

types/upload.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ declare global {
1818
githubToken?: string;
1919
githubApiHost?: string;
2020
githubAppToken?: string;
21+
githubStatusContextSuffix?: string;
2122
serverBaseUrl: string;
2223
urlReplacementPatterns: string[];
2324
}

0 commit comments

Comments
 (0)