-
Notifications
You must be signed in to change notification settings - Fork 85
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
JFrog CLI not reading environment variables correctly #120
Comments
Hi @kingledion, |
@kingledion Kindly inform us if this resolves your issues in the most recent version. Feel free to keep applying the v3 tag to access the latest updates. |
We have the same issue since today. The latest v3 action didn't fix this.
The last working commit hash was ea63b04. |
Hi @fschoenm |
I don't know if it matters but the setup-jfrog-cli job works, it's the post job that fails. |
Here's some logging output (only an excerpt, the re-run doesn't go through completely because we can't re-upload the same files):
Workflow is more or less this: env:
JFROG_CLI_BUILD_NAME: ${{ github.event.repository.name }}
jobs:
publish-to-artifactory:
name: Publish artifacts to Artifactory
needs: build-and-test
runs-on: [self-hosted, Linux, Docker]
steps:
- name: Checkout project
uses: actions/checkout@v3
with:
path: ${{ github.event.repository.name }}
- name: Download artifacts (Debug)
uses: actions/download-artifact@v3
with:
name: Build output (Debug)
path: artifacts/Debug
- name: Setup JFrog CLI
uses: jfrog/setup-jfrog-cli@v3
env:
JF_URL: https://artifactory.company.com/
JF_ACCESS_TOKEN: ${{ secrets.TRS_ARTIFACTORY_TOKEN }}
with:
version: latest
download-repository: bt-vs-jfrog-cli-remote
- name: Upload to Artifactory (Debug)
run: |
jf rt upload \
bin/ \
bt-vs-generic-dev-local/${{ env.JFROG_CLI_BUILD_NAME }}/${{ env.JFROG_CLI_BUILD_NAME }}-${{ needs.build-and-test.outputs.version }}-${{ env.JFROG_CLI_BUILD_NUMBER }}-Debug.zip \
--module Debug \
--archive=zip
working-directory: artifacts/Debug
- name: Publish build info
run: |
jf rt build-add-git
jf rt build-publish --detailed-summary
working-directory: ${{ github.event.repository.name }}
- name: Add build info to workflow summary
run: |
echo '```' >> $GITHUB_STEP_SUMMARY
jf rt search \
--build ${{ env.JFROG_CLI_BUILD_NAME }}/${{ env.JFROG_CLI_BUILD_NUMBER }} >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY |
@yahavi The new version is not fixing the error for us. The same "Post Setup JFrog CLI" step is failing as with @fschoenm's case. Debug logs:
|
Looks like the problem is that the setup step never initializes At this point in the code you are looking for the credentials: https://github.com/jfrog/setup-jfrog-cli/blob/master/src/utils.ts#L393 It is called here with credentials passed through unchanged from the method argument: https://github.com/jfrog/setup-jfrog-cli/blob/master/src/utils.ts#L172 And initially called here by the cleanup function with an empty struct as argument: https://github.com/jfrog/setup-jfrog-cli/blob/master/src/cleanup.ts#L7 You need to add a step to get CLI credentials like this: https://github.com/jfrog/setup-jfrog-cli/blob/master/src/main.ts#L8 I'm on my phone and my work computer won't let me fork a non-enterprise repo, so I can't push a PR until this evening. |
Hi @kingledion and @fschoenm , |
@kingledion @fschoenm, |
Yes, confirmed working. Thanks for the fix. |
Also works for us, thanks. |
Describe the bug
A previously working reference to
setup-jfrog-cli@v3
stopped working. The root cause is that theJF_URL
environment variable does not appear to be recognized. The changed code is here: https://github.com/jfrog/setup-jfrog-cli/pull/117/files#diff-39b2554fd18da165b59a6351b1aafff3714e2a80c1435f2de9706355b4d32351R86It looks like there are unit tests for this specific use case, I cannot tell from looking at the code exactly what is going wrong.
Current behavior
The following error:
Reproduction steps
We are using the action in the following GitHub Action job step:
The text was updated successfully, but these errors were encountered: