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.