Describe the bug
On self-hosted runners, JFrog CLI server configs in ~/.jfrog/ are never cleaned up after a job when using JF_ENV_* config tokens for authentication. configJFrogServers() has two code paths — when using JF_ENV_*, it calls jf config import directly and never reaches getServerIdForConfig(), which is the only place SETUP_JFROG_CLI_SERVER_IDS is written via core.exportVariable. Since that env var is empty, shouldSkipCleanup() exits silently at debug level and ~/.jfrog/ is never cleaned. Stale server configs accumulate with every run.
For now it's possible to workaround this by manually setting JFROG_CLI_HOME_DIR env var
Current behavior
Here are the snippet for run logs for setup-jfrog-cli:
Found JFrog CLI in cache. No need to download
/***/_work/_tool/jf/2.91.0/x64/jf config import ***
02:33:23 [Debug] JFrog CLI version: 2.91.0
02:33:23 [Debug] OS/Arch: linux/amd64
02:33:23 [Info] Importing server ID 'artifactory_jenkins'
And the post action:
##[debug]Evaluating condition for step: 'Post Setup JFrog CLI'
##[debug]Evaluating: always()
##[debug]Evaluating always:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Post Setup JFrog CLI
##[debug]Loading inputs
##[debug]Loading env
Post job cleanup.
##[debug]isExplicit: 2.91.0
##[debug]explicit? true
##[debug]checking cache: /***/_work/_tool/jf/2.91.0/x64
##[debug]Found tool in cache jf 2.91.0 x64
##[debug]isExplicit: 2.91.0
##[debug]explicit? true
##[debug]checking cache: /***/_work/_tool/jfrog/2.91.0/x64
##[debug]Found tool in cache jfrog 2.91.0 x64
##[debug]No servers are configured. Skipping cleanup.
##[debug]Node Action run completed with exit code 0
##[debug]Finishing: Post Setup JFrog CLI
Reproduction steps
- Use a self-hosted runner
- Authenticate via
JF_ENV_1: ${{ secrets.MY_CONFIG_TOKEN }} (no JF_URL/JF_ACCESS_TOKEN)
- Run the job — post-step skips cleanup silently
- Check
~/.jfrog/ on the runner — stale server configs accumulate with every run
Expected behavior
Server configs imported via JF_ENV_* should be cleaned up by the post-step, the same way as configs added via JF_URL/JF_ACCESS_TOKEN.
Setup JFrog CLI version
v5.0.0
JFrog CLI version
2.91.0
Workflow operating system type and version
Ubuntu 24.04
JFrog Artifactory version (if relevant)
No response
JFrog Xray version (if relevant)
No response
Describe the bug
On self-hosted runners, JFrog CLI server configs in
~/.jfrog/are never cleaned up after a job when usingJF_ENV_*config tokens for authentication.configJFrogServers()has two code paths — when usingJF_ENV_*, it callsjf config importdirectly and never reachesgetServerIdForConfig(), which is the only placeSETUP_JFROG_CLI_SERVER_IDSis written viacore.exportVariable. Since that env var is empty,shouldSkipCleanup()exits silently at debug level and~/.jfrog/is never cleaned. Stale server configs accumulate with every run.For now it's possible to workaround this by manually setting
JFROG_CLI_HOME_DIRenv varCurrent behavior
Here are the snippet for run logs for setup-jfrog-cli:
And the post action:
Reproduction steps
JF_ENV_1: ${{ secrets.MY_CONFIG_TOKEN }}(noJF_URL/JF_ACCESS_TOKEN)~/.jfrog/on the runner — stale server configs accumulate with every runExpected behavior
Server configs imported via
JF_ENV_*should be cleaned up by the post-step, the same way as configs added viaJF_URL/JF_ACCESS_TOKEN.Setup JFrog CLI version
v5.0.0
JFrog CLI version
2.91.0
Workflow operating system type and version
Ubuntu 24.04
JFrog Artifactory version (if relevant)
No response
JFrog Xray version (if relevant)
No response