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

Closed

Conversation

joseph-sentry
Copy link

@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 (f691d46) to head (9a328fc).

❗ Current head 9a328fc differs from pull request most recent head b7e79c8. Consider uploading reports for the commit b7e79c8 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1410      +/-   ##
==========================================
- Coverage   91.29%   90.35%   -0.94%     
==========================================
  Files           4        4              
  Lines         310      311       +1     
  Branches       85       84       -1     
==========================================
- Hits          283      281       -2     
- Misses         25       30       +5     
+ Partials        2        0       -2     
Flag Coverage Δ
demo 90.35% <100.00%> (-0.94%) ⬇️
macos-latest 90.35% <100.00%> (-0.94%) ⬇️
macos-latest-xlarge 90.35% <100.00%> (-0.94%) ⬇️
script 90.35% <100.00%> (-0.94%) ⬇️
ubuntu-latest 90.35% <100.00%> (-0.94%) ⬇️
version ?
windows-latest 90.35% <100.00%> (-0.94%) ⬇️

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.

@@ -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

Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
@@ -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

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