From 93b6e1cf0c3e8b3d2deb778fe3f2e9f8f046a64d Mon Sep 17 00:00:00 2001 From: Guy Owen Date: Mon, 18 Nov 2024 15:50:46 +1100 Subject: [PATCH 1/2] [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 From 0ec2dda546f3d978b1a04bce6ab92849687e0e54 Mon Sep 17 00:00:00 2001 From: Guy Owen Date: Mon, 18 Nov 2024 16:24:10 +1100 Subject: [PATCH 2/2] [332] Updated conditional. --- .github/workflows/build-deploy.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index f8b2b723..7dfe7113 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -36,12 +36,11 @@ jobs: - uses: actions/checkout@v3 if: |- github.event.pull_request.merged == true || - contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) + contains(fromJson('["schedule", "workflow_dispatch"]'), github.event_name) || + github.event_name == 'pull_request' && startsWith(github.head_ref,'build/') - 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') ) + if: ( github.event.issue.pull_request && contains(github.event.comment.body, '/build') ) with: ref: refs/pull/${{ github.event.issue.number }}/head