mr-smithers-excellent / docker-build-push

Docker Build & Push GitHub Action
MIT License
280 stars 62 forks source link

Conditionally Setting `addLatest` does not work for truthy values #228

Closed CodeVachon closed 5 months ago

CodeVachon commented 5 months ago

When using an expression for the addLatest input, a trueful value is ignored.

name: Build

on:
  release:
    types: [published]

jobs:
  Build:
    name: build docker image
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: mr-smithers-excellent/docker-build-push@v6.3
        name: Build & Push App Docker Image
        with:
          image: app
          registry: ghcr.io
          dockerfile: Dockerfile
          addLatest: ${{ !contains(github.ref_name, 'RC') }}

Expected

With the above workflow:

Actual

With the above workflow:

mr-smithers-excellent commented 5 months ago

@CodeVachon - thanks for bringing up this issue. Will get this PR reviewed and tested ASAP!