From ea5bf4cf5d091aa851c8b3bc79a937a2422b3d04 Mon Sep 17 00:00:00 2001 From: wylab Date: Sat, 14 Feb 2026 02:59:01 +0100 Subject: [PATCH] ci: require build pass before PR merge - Add pull_request trigger to build workflow - Skip push and cache-to on PRs (build-only validation) Co-Authored-By: Claude Opus 4.6 --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da5dcbd..df9a004 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,8 @@ name: Build Nanobot OAuth on: push: branches: ['main'] + pull_request: + branches: ['main'] workflow_dispatch: env: @@ -39,8 +41,8 @@ jobs: provenance: false platforms: linux/amd64 cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache - cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max - push: true + cache-to: ${{ github.event_name != 'pull_request' && format('type=registry,ref={0}/{1}:buildcache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} + push: ${{ github.event_name != 'pull_request' }} tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}