github actions: Post "--user/api/security/token": unsupported protocol scheme ""

2.3k Views Asked by At

I am trying to push a docker image to jfrog using github actions. I am able to build image but while pushing i am getting following error. Error: Post "--user/api/security/token": unsupported protocol scheme "" Error: Process completed with exit code 1.

name: Pushing Docker image to Jfrog
on: push
  
jobs:
  build-image:
    runs-on: ubuntu-latest
    steps:
    - uses: jfrog/setup-jfrog-cli@v1
    - uses: actions/checkout@v2
    - name: building and pushing image to jfrog
      run: |
       #curl -fL https://getcli.jfrog.io | sh
       jfrog --version
       jfrog rt config MyArtifactory --url $ARTIFACTORY_URL --user $ARTIFACTORY_USER --apikey $ARTIFACTORY_PASS
       docker login -u "${ARTIFACTORY_USER}" -p "${ARTIFACTORY_PASS}" "${ARTIFACTORY_DOCKER_REPOSITORY}"
       docker build  --rm=false -t vpadala-docker-local.jfrog.io/jfrog_ret:${{ github.run_id }} .
       docker run -d -p 8081:8081 vpadala-docker-local.jfrog.io/jfrog_ret:${{ github.run_id }}; sleep 10
       docker ps
       jfrog rt docker-push vpadala-docker-local.jfrog.io/jfrog_ret:${{ github.run_id }} docker-local
1

There are 1 best solutions below

0
On

It looks like you're trying to read environment variables instead of reading GitHub action secrets.

Secrets should be read as following: ${{ secrets.SecretName }}, for example:

jfrog config add MyArtifactory --artifactory-url ${{ secrets.ARTIFACTORY_URL }} --user ${{ secrets.ARTIFACTORY_USER }} --password ${{ secrets.ARTIFACTORY_PASS }}

Read more about secrets here: https://docs.github.com/en/actions/reference/encrypted-secrets#using-encrypted-secrets-in-a-workflow