diff --git a/.github/workflows/showtime-trigger.yml b/.github/workflows/showtime-trigger.yml index 1bff3e92f9d..fc3ddff6953 100644 --- a/.github/workflows/showtime-trigger.yml +++ b/.github/workflows/showtime-trigger.yml @@ -61,17 +61,8 @@ jobs: console.log(`📊 Permission level for ${actor}: ${permission.permission}`); const authorized = ['write', 'admin'].includes(permission.permission); - if (!authorized) { - console.log(`🚨 Unauthorized user ${actor} - skipping all operations`); - core.setOutput('authorized', 'false'); - return; - } - - console.log(`✅ Authorized maintainer: ${actor}`); - core.setOutput('authorized', 'true'); - - // If this is a synchronize event, check if Showtime is active and set blocked label - if (context.eventName === 'pull_request_target' && context.payload.action === 'synchronize') { + // If this is a synchronize event from unauthorized user, check if Showtime is active and set blocked label + if (!authorized && context.eventName === 'pull_request_target' && context.payload.action === 'synchronize') { console.log(`🔒 Synchronize event detected - checking if Showtime is active`); // Check if PR has any circus tent labels (Showtime is in use) @@ -99,6 +90,15 @@ jobs: } } + if (!authorized) { + console.log(`🚨 Unauthorized user ${actor} - skipping all operations`); + core.setOutput('authorized', 'false'); + return; + } + + console.log(`✅ Authorized maintainer: ${actor}`); + core.setOutput('authorized', 'true'); + - name: Install Superset Showtime if: steps.auth.outputs.authorized == 'true' run: |