Evaluate expressions in with-configuration

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-github-actions#inputs to be sure to get a specific datatype as an input.

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-expression-syntax-for-github-actions#about-context-and-expressions

1 Like