Skip to content

Commit

Permalink
Use startsWith instead of contains in action condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mingchen committed Sep 3, 2023
1 parent 0cb5141 commit 127aaca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ jobs:
- name: Build and load local docker image for PRs or Not Tags
uses: docker/[email protected]
if: github.event_name == 'pull_request' || !${{contains(github.ref, 'refs/tags/')}}
if: github.event_name == 'pull_request' || !startsWith(github.ref, 'refs/tags/')
with:
context: .
load: true
tags: ${{ env.IMAGE_NAME}}:${{ env.TAG}}

- name: Build and load local docker image for Not PRs and Tags
uses: docker/[email protected]
if: github.event_name != 'pull_request' && (contains(github.ref, 'refs/tags/'))
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/')
with:
context: .
load: true
Expand Down

0 comments on commit 127aaca

Please sign in to comment.