From 93b6e1cf0c3e8b3d2deb778fe3f2e9f8f046a64d Mon Sep 17 00:00:00 2001 From: Guy Owen Date: Mon, 18 Nov 2024 15:50:46 +1100 Subject: [PATCH] [332] Added conditional checkout. --- .github/workflows/build-deploy.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 147ad0f1..f8b2b723 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -34,6 +34,16 @@ jobs: uses: docker/setup-buildx-action@v3 - uses: actions/checkout@v3 + if: |- + github.event.pull_request.merged == true || + contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) + + - uses: actions/checkout@v3 + if: |- + github.event_name == 'pull_request' && startsWith(github.head_ref,'build/') || + ( github.event.issue.pull_request && contains(github.event.comment.body, '/build') ) + with: + ref: refs/pull/${{ github.event.issue.number }}/head - name: Login to registry ${{ env.REGISTRY }} uses: docker/login-action@v2.2.0