Simplify if condition by using startsWith

Should now be equivalent to the previous one.
This commit is contained in:
rugk 2023-11-18 17:15:07 +01:00 committed by GitHub
parent ac988f2a24
commit 545a6dfd3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,13 +31,13 @@ jobs:
install: true
- name: Login to DockerHub
uses: docker/login-action@v3
if: github.event_name != 'pull_request' || github.event_name == 'schedule'
if: ${{ github.event_name != 'pull_request' && (github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/')) }}
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request' || github.event_name == 'schedule'
if: ${{ github.event_name != 'pull_request' && (github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/')) }}
with:
registry: ghcr.io
username: privatebin