Skip to content

Commit

Permalink
feat: Remove token from Other CI onboarding step 3
Browse files Browse the repository at this point in the history
  • Loading branch information
calvin-codecov committed Oct 29, 2024
1 parent a8a4b15 commit 0fb7064
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions src/pages/RepoPage/CoverageOnboarding/OtherCI/OtherCI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ function OtherCI() {
const tokenCopy = orgUploadToken ? 'global' : 'repository'

const apiUrlCopy = config.IS_SELF_HOSTED ? ` -u ${config.API_URL}` : ''
const uploadCommand = `./codecov${apiUrlCopy} upload-process -t ${uploadToken}${
orgUploadToken ? ` -r ${repo}` : ''
}`

const repoTokenUploadCommand = `./codecov${apiUrlCopy} upload-process`
const orgTokenUploadCommand = orgUploadToken
? `./codecov${apiUrlCopy} upload-process -r ${repo}`
: ''

return (
<div className="flex flex-col gap-6">
<Step1 tokenCopy={tokenCopy} uploadToken={uploadToken} />
<Step2 />
<Step3 uploadCommand={uploadCommand} />
<Step3
repoTokenUploadCommand={repoTokenUploadCommand}
orgTokenUploadCommand={orgTokenUploadCommand}
/>
<Step4 />
<FeedbackCTA />
<LearnMoreBlurb />
Expand Down Expand Up @@ -106,10 +111,11 @@ function Step2() {
}

interface Step3Props {
uploadCommand: string
repoTokenUploadCommand: string
orgTokenUploadCommand: string
}

function Step3({ uploadCommand }: Step3Props) {
function Step3({ repoTokenUploadCommand, orgTokenUploadCommand }: Step3Props) {
return (
<Card>
<Card.Header>
Expand All @@ -119,7 +125,18 @@ function Step3({ uploadCommand }: Step3Props) {
</Card.Title>
</Card.Header>
<Card.Content className="flex flex-col gap-4">
<CodeSnippet clipboard={uploadCommand}>{uploadCommand}</CodeSnippet>
<p>If you are using a repo token, use this script.</p>
<CodeSnippet clipboard={repoTokenUploadCommand}>
{repoTokenUploadCommand}
</CodeSnippet>
{!!orgTokenUploadCommand ? (
<>
<p>If you are using an org token, use this script.</p>
<CodeSnippet clipboard={orgTokenUploadCommand}>
{orgTokenUploadCommand}
</CodeSnippet>
</>
) : null}
<ExampleBlurb />
</Card.Content>
</Card>
Expand Down

0 comments on commit 0fb7064

Please sign in to comment.