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

226
Visualizações
Can't pass environment variable from GitHub Actions to nodejs script

To be short I have an Angular app where I have env config. I decided to write a build number directly into the field of that config file.

So I made a script that is being run by Node after checkout and before the actual build step and writes a build number into that file. This is a fragment of my GitHub Actions workflow yml for it:

        run: |
          npm install
          node setbuildnumber.js build=${{ env.GITHUB_ACTION }}
          npm run build-demo

The script works when I test it separately. And it runs in Actions as I see. But after I build and deploy my Angular app, I see my build number is undefined.

Before writing a question, I looked through Stack Overflow topics and only found a variant where it was recommended to write a variable value to file and then read it with Node script. But that solution looks unclean.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I'm sure now that arguments aren't being passed into the node script. So I've written the variable name into the temporary file, read it, written it into the angular environment configs recursively and deleted the file after all. This is the only thing that worked for me practically.

about 4 years ago · Juan Pablo Isaza 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