Skip to content

GitHub Action

Setup JFrog CLI

v1.0.2 Latest version
Use latest version

Setup JFrog CLI

Install and configure JFrog CLI


Copy and paste the following snippet into your .yml file.

- name: Setup JFrog CLI
  uses: jfrog/setup-jfrog-cli@v1.0.2
Learn more about this action in jfrog/setup-jfrog-cli
Choose a version

Build status

Setup JFrog CLI

This GitHub Action downloads, installs and configures JFrog CLI, so that it can be used as part of the workflow.

In addition, the Action includes the following features, when using JFrog CLI to work with Artifactory.

  • The connection details of the Artifactory servers used by JFrog CLI can be stored as secrets. Read more about it here.
  • There's no need to add the build name and build number options and arguments to commands which accpet them. All build related operations will be automatically recorded with the Workflow Name as build name and Commit Hash as build number.



- uses: jfrog/setup-jfrog-cli@v1
- run: jfrog --version

Storing Artifactory Servers Details as Secrets


The connection details of the Artifactory servers used by JFrog CLI can be stored as secrets.

Crating the Configuration on Your Local Machine

  1. Make sure JFrog CLI version 1.29.0 or above is installed on your local machine by running jfrog -v.
  2. Configure the details of the Artifactory server by running jfrog rt c.
  3. Export the details of the Artifactory server you configured, using the server ID you chose. Do this by running jfrog rt c export <SERVER ID>.
  4. Copy the generated token to the clipboard and save it as a secret on GitHub.

Using the Secret in the Workflow

To use the saved Artifactory server configuration in the workflow, all you need to do it to expose the secret to the workflow. The secret should be exposed as an environment variable with the JF_ARTIFACTORY_ prefix. Here's how you do this:

- uses: jfrog/setup-jfrog-cli@v1
- run: |
    # Ping the server
    jfrog rt ping

As you can see in the example above, we created a secret named JF_ARTIFACTORY_SECRET_1 and we exposed it to the workflow as the JF_ARTIFACTORY_1 environment variable. That's it - the ping command will now ping the configured Artifactory server.

If you have multiple Artifactory servers configured as secrets, you can use all of the in the workflow as follows:

- uses: jfrog/setup-jfrog-cli@v1
- run: |
    # Set the Artifactory server to use by providing the server ID (configured by the 'jfrog rt c' command).
    jfrog rt use local-1
    # Ping local-1
    jfrog rt ping
    # Now use the second sever configuration exposed to the Action.
    jfrog rt use local-2
    # Ping local-2
    jfrog rt ping
Important: When exposing more than one Artifactory servers to the Action, you should always add the jfrog rt use command to specify the server to use.

Setting the Build Name and Build Number When Publishing Build-Info to Artifactory

The Action automatically sets the following environment variables: JFROG_CLI_BUILD_NAME and JFROG_CLI_BUILD_NUMBER with the workflow name and commit hash respectively. You therefore don't need to specify the build name and build number on any of the build related JFrog CLI commands.

In the following example, all downloaded files are registered as depedencies of the build and all uploaded files are registered as the build artifacts.

- run: |
    jfrog rt dl artifacts/
    jfrog rt u aether artifacts/
    jfrog rt bp

Setting JFrog CLI Version

By default the JFrog CLI version set in action.yml is used. To set a specific version, add the version input as follows:

- uses: jfrog/setup-jfrog-cli@v1
    version: X.Y.Z
Important: Only JFrog CLI versions 1.29.0 or above are supported.

Example Project

To help you get started, you can use this sample project on GitHub.

Developing the Action code

Build the Code

If you'd like to help us develop and enhance this Action, this section is for you.

To build and run the Action tests, run

npm i && npm t

Code Contributions

We welcome code contributions through pull requests.

Please help us enhance and improve this Action.

Pull Requests Guidelines

  • Follow the instructions in
  • If the existing tests do not already cover your changes, please add tests.
  • Please run npm run format for formatting the code before submitting the pull request.


This Action is licensed under the Apache License 2.0.


You can’t perform that action at this time.