Skip to content

Conversation

@nirvanin
Copy link
Contributor

@nirvanin nirvanin commented Jul 21, 2025

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • I used npm run format for formatting the code before submitting the pull request.

@github-actions
Copy link

github-actions bot commented Jul 21, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@nirvanin
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

lib/utils.js Outdated
let cliConfigCmd = ['config'];
let cliConfigCmd = [];
let githubToken = jfrogCredentials.githubToken;
if (!!githubToken) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we have this in both ts and js ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually js is locally compiled from ts, and both of them are added to git. I also was surprised, but it's how it's organized now

Copy link
Contributor

@EyalDelarea EyalDelarea left a comment

Choose a reason for hiding this comment

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

Hey,
I know it seems just to pass an extra value to the jf c add command but i do have a few questions.

  1. I didn't see the param documented in the CLI itself
  2. There is no docs here or in the CLI what is token used for and what is the purpose of this token.
  3. What happens if i have multiple GitHub tokens for multiple repos, which they are all connected to one jfrog instance?
  4. We should check CLI version before adding the extra param and make sure we are backwards compatible

src/utils.ts Outdated

public static async configJFrogServers(jfrogCredentials: JfrogCredentials) {
let cliConfigCmd: string[] = ['config'];
let cliConfigCmd: string[] = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't see the param in the config add params:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's global flag, relevant not only for configuration.

jf --help
GLOBAL OPTIONS:
   --github-token value  Github token which is used to call github api

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is no need to have access to different repos, github call is only used for cli version self-check on github releases, which is public.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's backward compatible, updated cli can be used without github token param and old cli can be called with github token param.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay
So if it is not server specific, let's maybe move it to another place so it will be clear.

package.json Outdated
{
"name": "@jfrog/setup-jfrog-cli",
"version": "4.5.11",
"version": "4.5.12",
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be done in a separate PR just to bump version before release

Utils.exportVariableIfNotSet('JFROG_CLI_SOURCECODE_REPOSITORY', process.env.GITHUB_REPOSITORY ?? '');
Utils.exportVariableIfNotSet('JFROG_CLI_CI_JOB_ID', process.env.GITHUB_WORKFLOW ?? '');
Utils.exportVariableIfNotSet('JFROG_CLI_CI_RUN_ID', process.env.GITHUB_RUN_ID ?? '');
Utils.exportVariableIfNotSet('JFROG_CLI_GITHUB_TOKEN', process.env.GITHUB_TOKEN ?? '');
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥

@EyalDelarea EyalDelarea added safe to test Approve running integration tests on a pull request improvement Automatically generated release notes labels Aug 7, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Aug 7, 2025
@EyalDelarea EyalDelarea changed the title JPI-396 - add github token param Export JFROG_CLI_GITHUB_TOKEN env var Aug 7, 2025
@EyalDelarea EyalDelarea added bug Something isn't working and removed improvement Automatically generated release notes labels Aug 11, 2025
@EyalDelarea EyalDelarea merged commit 88389c9 into jfrog:master Aug 11, 2025
37 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

action consumes github anonymous rest api rate limit

3 participants