
Table of Contents
Overview
This GitHub Action downloads, installs and configures JFrog CLI, so that it can be used as part of the workflow.
Additionally, the Action incorporates the following features when utilizing JFrog CLI to interact with the JFrog Platform:
- Versatile authentication methods - Three distinct methods are available for authenticating with the JFrog Platform.
- Seamless build info generation - All build related operations will be automatically recorded, and the collected build info will be published at the end of the workflow. There's no need to add the build name and build number options and arguments to commands which accept them, and no need to run
jf rt build-publish for the build to be published.
- Extensive Job Summary - A detailed summary of key JFrog CLI commands executed during the workflow will be generated and displayed in the GitHub Actions run page.
- Automatic Evidence Collection - When a GitHub attestations are created using the standard GitHub actions, it is automatically collected into the JFrog platform at the end of the workflow.
Usage
- uses: jfrog/setup-jfrog-cli@v4
# + Authentication method
- run: jf --version
Authentication Methods
JFrog CLI integrates with the JFrog Platform. In order to facilitate this connection, certain connection details of the JFrog Platform must be provided.
There are three methods to provide these details, and you only need to choose one method:
๐ค Connecting to JFrog using OIDC (OpenID Connect)
General
The sensitive connection details, such as the access token used by JFrog CLI on the JFrog platform, can be automatically generated by the action instead of storing it as a secret in GitHub.
This is made possible by leveraging the OpenID-Connect (OIDC) protocol.
This protocol can authenticate the workflow issuer and supply a valid access token, requiring only the JF_URL environment variable.
Learn more about this integration in this blog post.
To utilize the OIDC protocol, follow these steps:
JFrog Platform configuration
- Configure an OIDC Integration: This phase sets an integration between GitHub Actions to the JFrog platform.
- Navigate to the Administration tab In the JFrog Platform UI
- Click
General | Manage Integrations
- Click
New Integration | OpenID Connect:

- Configure the OIDC integration:

| NOTE: |
| The value specified as the 'Provider Name' should be used as the oidc-provider-name input in Workflow configuration step 2 below. |
| The 'Audience' field does not represent the 'aud' claim for insertion into the identity-mapping in Platform configuration step 2 below. Only the claims included in the Claims Json created during step 2 will be validated. |
-
Configure an identity mapping: This phase sets an integration between a particular GitHub repository to the JFrog platform.
An identity mapping is a configuration object utilized by the JFrog Platform to associate incoming OIDC claims with particular selected fields. These fields might include repository, actor, workflow, and others.
To configure the identity mapping, click on the identity mapping created in section 1 and then click on Add Identity Mapping. Fill in priority 1 and fill out all required fields:

You have the flexibility to define any valid list of claims required for request authentication. You can check a list of the possible claims here.
Example Claims JSON:
{
"repository": "repository-owner/repository-name"
}
Workflow configuration
-
Set required permissions: In the course of the protocol's execution, it's imperative to acquire a JSON Web Token (JWT) from GitHub's OIDC provider. To request this token, it's essential to configure the specified permission in the workflow file:
permissions:
id-token: write
-
Pass the 'oidc-provider-name' input to the Action (Required): The 'oidc-provider-name' parameter designates the OIDC configuration whose one of its identity mapping should align with the generated JWT claims. This input needs to align with the 'Provider Name' value established within the OIDC configuration in the JFrog Platform.
-
Pass the 'oidc-audience' input to the Action (Optional): The 'oidc-audience' input defines the intended recipients of an ID token (JWT), ensuring access is restricted to authorized recipients for the JFrog Platform. By default, it contains the URL of the GitHub repository owner. It enforces a condition, allowing only workflows within the designated repository/organization to request an access token. Read more about it here.
Example step utilizing OpenID Connect:
- uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ vars.JF_URL }}
with:
oidc-provider-name: setup-jfrog-cli
Notice:
Depending on the version of the CLI and how it is provisioned, this action intelligently chooses the optimal OIDC authentication flow:
โ
Native OIDC (Recommended Path)
If you are using JFrog CLI version 2.75.0 or above and not downloading the CLI from Artifactory
(via the download-repository input),
the setup action will use the CLI's native --oidc-token-id authentication mechanism.
๐ Manual Fallback (for legacy or remote setups)
If the CLI version is below 2.75.0, or if you're downloading the CLI from Artifactory using download-repository, the action will automatically fall back to a manual OIDC token exchange using the JFrog Platform REST API.
๐ This fallback logic is kept for backward compatibility but is planned for deprecation to avoid maintaining duplicate authentication flows.
Handling Self-Signed Certificates
If your JFrog instance is configured with a self-signed SSL certificate, you may encounter errors with the GitHub Actions HTTP client not trusting your certificate. To help Node.js recognize and trust your self-signed certificate, follow these steps:
-
Prepare the SSL Certificate: Save your SSL certificate chain, including the root CA and any intermediate certificates, into a .pem file. Ensure that this file is accessible within your GitHub Actions environment.
-
Set the Environment Variable: In your GitHub Actions workflow, set the NODE_EXTRA_CA_CERTS environment variable to specify the location of your .pem file. Add the following line to your workflow:
env:
NODE_EXTRA_CA_CERTS: /path/to/certificate/server.pem
Replace /path/to/certificate/server.pem with the actual path to your certificate file on your runner.
๐ Storing the connection details using environment variables
The connection details of the JFrog platform used by this action can be stored as GitHub secrets (or GitHub Variables for non-secret values)
You can set the connection details to your JFrog Platform by using one of the following combinations:
- JF_URL (no authentication)
- JF_URL + JF_USER + JF_PASSWORD (basic authentication)
- JF_URL + JF_ACCESS_TOKEN (authentication using a JFrog Access Token)
You can use these environment variables in your workflow as follows:
- uses: jfrog/setup-jfrog-cli@v4
env:
# JFrog Platform url
JF_URL: ${{ vars.JF_URL }} # or 'https://acme.jfrog.io'
# Basic authentication credentials
JF_USER: ${{ secrets.JF_USER }}
JF_PASSWORD: ${{ secrets.JF_PASSWORD }}
# or
# JFrog Platform access token
JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }}
- run: |
jf rt ping
โ๏ธ Storing the connection details using single Config Token
- Make sure JFrog CLI is installed on your local machine by running
jf -v.
- Configure the details of the JFrog platform by running
jf c add.
- Export the details of the JFrog platform you configured, using the server ID you chose. Do this by running
jf c export <SERVER ID>.
- Copy the generated Config Token to the clipboard and save it as a secret on GitHub.
To use the saved JFrog platform 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 JFENV prefix.
Here's how you do this:
- uses: jfrog/setup-jfrog-cli@v4
env:
JF_ENV_1: ${{ secrets.JF_SECRET_ENV_1 }}
- run: |
# Ping the server
jf rt ping
As you can see in the example above, we created a secret named JF_SECRET_ENV_1 and exposed it to the workflow
as the JF_ENV_1 environment variable. That's it - the ping command will now ping the configured Artifactory server.
If you have multiple Config Tokens as secrets, you can use all of them in the workflow as follows:
- uses: jfrog/setup-jfrog-cli@v4
env:
JF_ENV_1: ${{ secrets.JF_SECRET_ENV_1 }}
JF_ENV_2: ${{ secrets.JF_SECRET_ENV_2 }}
- run: |
# Set the utilized JFrog configuration by providing the server ID (configured by the 'jf c add' command).
jf c use local-1
# Ping local-1 Artifactory server
jf rt ping
# Now use the second sever configuration exposed to the Action.
jf c use local-2
# Ping local-2 Artifactory server
jf rt ping
Important: When exposing more than one JFrog configuration to the Action, you should always add the jf c use command to specify the server to use. |
Important: If both Config Token(JF_ENV_*) and separate environment variables(JF_URL, ...) are provided, the default config will be the Config Token. To make the above separate environment variables as the default config use jf c use setup-jfrog-cli-server |
General Configuration
Setting build name and number for build info publication to Artifactory
Setting Build Name and Number for Build Info Publication