I'm trying to run a Github Action locally with nektos/act. I have Docker setup and everything works fine until I reference a Github variable (not a secret). Then I get the following error:
Unable to interpolate expression 'format('{0}', vars.APP_ID)': Unavailable context: vars
How do I setup the vars
context using a .env file?
on:
pull_request:
push:
jobs:
build-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: npm ci
working-directory: test/unit
- name: Run Unit Tests
run: npm run test:ci
working-directory: test/unit
- name: Install Integration Test Dependencies
run: npm ci
working-directory: test/integration
- name: Run Integration Tests
env:
APP_ID: ${{ vars.APP_ID }}
#...omitted
It's currently not an option. The listed issue on github addresses it - i don't see how
act
is ready for prime-time without this!The workaround is to change your workflow file to use
env.
instead ofvars.
, and change it back when you are ready to push it up to github. This is not a good workaround! But it's the best anyone seems to be able to offer.