Skip to content

Commit

Permalink
fix(gha): fix condition for main branch workflow trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmorano committed Jun 20, 2023
1 parent e5f0f12 commit 2972f6d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/publish.yaml
Expand Up @@ -60,6 +60,7 @@ jobs:
else
# Make sure develop branch artifacts include SNAPSHOT
BRANCH=${GITHUB_REF##*/}
echo "BRANCH=${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT"
CURRENT_VERSION=$(xq -r .project.version pom.xml)
if [[ "${BRANCH}" == "develop" ]] && [[ "${CURRENT_VERSION}" =~ .*-SNAPSHOT$ ]]
then
Expand All @@ -75,7 +76,7 @@ jobs:
- name: Docker Login
uses: docker/login-action@v2
if: |
github.ref == 'refs/head/main' ||
steps.metadata.outputs.BRANCH == 'main' ||
steps.metadata.outputs.DEVELOP_SNAPSHOT_OK == 'true'
with:
registry: ${{ env.PRIVATE_DOCKER_REGISTRY_URL }}
Expand All @@ -85,7 +86,7 @@ jobs:
- name: Build and Push docker image
uses: docker/build-push-action@v4
if: |
github.ref == 'refs/head/main' ||
steps.metadata.outputs.BRANCH == 'main' ||
steps.metadata.outputs.DEVELOP_SNAPSHOT_OK == 'true'
with:
context: .
Expand Down

0 comments on commit 2972f6d

Please sign in to comment.