diff --git a/.github/workflows/ci-cd-trigger.yml b/.github/workflows/ci-cd-trigger.yml index d1bee761d..8fd1838a2 100644 --- a/.github/workflows/ci-cd-trigger.yml +++ b/.github/workflows/ci-cd-trigger.yml @@ -6,6 +6,8 @@ on: - release/* - develop - main + # uncomment pull_request and comment pull_request_target to test CI changes against feature branch not target branch (develop) + # pull_request: pull_request_target: types: - opened @@ -47,7 +49,7 @@ jobs: lint-pr-title: needs: node-modules - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} name: Verify PR title uses: ./.github/workflows/lint-pr.yml secrets: inherit @@ -112,7 +114,7 @@ jobs: cypress: needs: lint-test-build name: '(CI) cypress' - if: ${{ needs.lint-test-build.outputs.projects-e2e != '[]' }} + # if: ${{ needs.lint-test-build.outputs.projects-e2e != '[]' }} uses: ./.github/workflows/cypress-run.yml secrets: inherit with: @@ -122,7 +124,7 @@ jobs: publish-dist: needs: lint-test-build name: '(CD) publish dist' - if: ${{ needs.lint-test-build.outputs.projects != '[]' }} + # if: ${{ needs.lint-test-build.outputs.projects != '[]' }} uses: ./.github/workflows/publish-dist.yml secrets: inherit with: @@ -133,7 +135,7 @@ jobs: needs: - publish-dist - lint-test-build - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} timeout-minutes: 60 name: '(CD) comment preview links' steps: diff --git a/.github/workflows/publish-dist.yml b/.github/workflows/publish-dist.yml index d61215f86..2ca164c4b 100644 --- a/.github/workflows/publish-dist.yml +++ b/.github/workflows/publish-dist.yml @@ -33,7 +33,7 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Log in to the Container registry (ghcr) - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} uses: docker/login-action@v2 with: registry: ghcr.io @@ -100,7 +100,7 @@ jobs: ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local - name: Image digest - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} run: echo ${{ steps.docker_build.outputs.digest }} - name: Sanity check docker image @@ -115,7 +115,7 @@ jobs: uses: docker/build-push-action@v3 continue-on-error: true id: ghcr-push - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} with: context: . file: docker/node-outside-docker.Dockerfile @@ -185,7 +185,7 @@ jobs: - name: Add preview label uses: actions-ecosystem/action-add-labels@v1 - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} with: labels: ${{ matrix.app }}-preview number: ${{ github.event.number }}