Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for tokenless v3 #1410

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

joseph-sentry
Copy link
Contributor

@joseph-sentry joseph-sentry commented May 6, 2024

The idea is that we will detect that if this action is being run from a PR and that PR is from a fork to an upstream repo then we should upload using tokenless, so we will set the TOKENLESS env var so that we can pass the necessary information for the CLI to upload using tokenless

Necessary for: codecov/codecov-cli#434

Copy link

codecov bot commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.35%. Comparing base (feaf700) to head (9a328fc).

Current head 9a328fc differs from pull request most recent head 6c9378e

Please upload reports for the commit 6c9378e to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1410      +/-   ##
==========================================
- Coverage   91.66%   90.35%   -1.32%     
==========================================
  Files           4        4              
  Lines         312      311       -1     
  Branches       85       84       -1     
==========================================
- Hits          286      281       -5     
- Misses         26       30       +4     
Flag Coverage Δ
demo 90.35% <100.00%> (-1.32%) ⬇️
macos-latest 90.35% <100.00%> (-1.32%) ⬇️
macos-latest-xlarge 90.35% <100.00%> (?)
script 90.35% <100.00%> (-1.32%) ⬇️
ubuntu-latest 90.35% <100.00%> (-1.32%) ⬇️
version ?
windows-latest 90.35% <100.00%> (-1.32%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/buildExec.ts Outdated
@@ -31,7 +31,7 @@ const getGitService = (): string => {

const isFork = (): boolean => {
if (
`${context.eventName}` !== 'pull_request' ||
`${context.eventName}` !== 'pull_request' &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

@@ -47,6 +47,7 @@ const isPullRequestFromFork = (): boolean => {
const getToken = async (): Promise<string> => {
if (isPullRequestFromFork()) {
core.info('==> Fork detected, tokenless uploading used');
process.env['TOKENLESS'] = context.payload.pull_request.head.label;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you in this PR description link to the CLI change that is consuming this?

Copy link
Contributor

@thomasrockhu-codecov thomasrockhu-codecov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just need some documentation to how this will be consumed

@thomasrockhu-codecov
Copy link
Contributor

@joseph-sentry you will need to run npm run build locally I think. Or the install script should handle it when you commit

@joseph-sentry joseph-sentry merged commit 81c0a51 into codecov:main Jun 11, 2024
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants