Skip to content

Is the hashFiles function _actually_ available in the if context? #25790

Discussion options

You must be logged in to vote

@randori-jay funny you should just mention this a few days ago.

I finally got things working and trick is to add the always() function call to the if: check as well.

So the example above would be

build-docker-images:
    if: ${{ always() && hashFiles('Dockerfile') }}
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - name: Build Docker images
        run: #our-code-to-build-images

You can see it in action here: docker-elasticsearch/push.yml at 599cd66629452e99b3109d99ab28945dad822e4e · pelias/docker-elasticsearch · GitHub

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@evmckinney9
Comment options

Answer selected
Comment options

You must be logged in to vote
1 reply
@APCBoston
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants