Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 2

Evaluate expressions in with-configuration

Solved! Go to Solution.

Is it possible to evualuate environment variables in the `with`-configuration (see https://github.com/elgohr/Publish-Docker-Github-Action/issues/43#issuecomment-552186587)?
The action itself could do this aswell, but this would make every actions input much more dynamic, as user scripts could result in every datatype. Would be great if we could use https://help.github.com/en/actions/automating-your-workflow-with-github-actions/metadata-syntax-for-... to be sure to get a specific datatype as an input.

1 Reply
Solution
GitHub Partner
Message 2 of 2

Re: Evaluate expressions in with-configuration

To evaluate expressions in with configuration, you need to put your expression inside {{ }} .

Please try this:

name: CI
on:
  push:
    branches:
      - master

  schedule:
    - cron: '*/5 * * * *'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions/hello-world-docker-action@master
      with:
        who-to-greet: ${{ github.event_name != 'schedule' }}

 

You can refer to “About context and expressions document:

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-express...