diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 314ccd6..53d0770 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -4,13 +4,19 @@ on: pull_request: branches: - frontend - push: - branches: - - frontend + types: + - opened + - synchronize + workflow_dispatch: + pull_request_target: + types: + - closed + jobs: build-and-analyze: + if: github.event.pull_request.merged != true runs-on: ubuntu-latest steps: @@ -69,7 +75,7 @@ jobs: npx sonar-scanner -Dsonar.projectKey=$SONAR_PROJECT_KEY -Dsonar.projectName='lenka-messenger' -Dsonar.sources=src -Dsonar.pullrequest.key=${{ github.event.number}} -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} -Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} -Dsonar.host.url=$SONAR_HOST_URL deploy-to-dockerhub: - if: github.ref == 'refs/heads/frontend' + if: github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'frontend' runs-on: ubuntu-latest needs: build-and-analyze