Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

310
Visualizações
Use bash variables as parameters to a GitHub Action

I am calling a GitHub action, and I want to pass it the parameter extra_build_args with the value --build-arg CURRENT_DD_VERSION={$VER} (not in string) where $VER is a shell variable that I set with a specific version. When I check what was passed in I see it took the literal value {$VER} instead of resolving the variable. I set $VER in a different (earlier) step of the Github action. How can pass in the content of the shell variable as a parameter?

    - name: Get version
      run: |
        VER=$(cat ver.txt)
    - name: Build docker image
      uses: kciter/aws-ecr-action@v3
      with:
        //some more parameters
        extra_build_args: "--build-arg CURRENT_DD_VERSION={$VER}"
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Check first the syntax:

${VER}
# not
{$VER}

In your case:

extra_build_args: "--build-arg CURRENT_DD_VERSION=${VER}"

You also have the documentation "Environment variables"

To set custom environment variables, you need to specify the variables in the workflow file.
You can define environment variables for a step, job, or entire workflow using the jobs.<job_id>.steps[*].env, jobs.<job_id>.env, and env keywords.

The examples would use $VER
Or:

    extra_build_args: "--build-arg CURRENT_DD_VERSION=${{ env.VER }}"
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda