Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

225
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda