From 4f6863f31736f3bc5b0378d12538c101a6908963 Mon Sep 17 00:00:00 2001 From: Uruk Date: Tue, 30 Sep 2025 00:01:15 +0200 Subject: [PATCH] feat: add direct pull request trigger to artifact comment workflow Enables the workflow to run directly on pull request events (opened, synchronize, reopened) in addition to the existing workflow_run and manual dispatch triggers. Provides immediate status updates in PR checks and improves user experience by showing workflow progress directly in the pull request interface rather than only after completion of upstream workflows. --- .github/workflows/artifact-comment.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/artifact-comment.yml b/.github/workflows/artifact-comment.yml index f7d5ff04..4d7df677 100644 --- a/.github/workflows/artifact-comment.yml +++ b/.github/workflows/artifact-comment.yml @@ -6,6 +6,8 @@ concurrency: on: workflow_dispatch: # Allow manual testing + pull_request: # Show in PR checks and provide status updates + types: [opened, synchronize, reopened] workflow_run: workflows: - "🤖 Android APK Build (Phone + TV)" @@ -16,7 +18,7 @@ on: jobs: comment-artifacts: - if: github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request') + if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' || (github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request') runs-on: ubuntu-latest permissions: contents: read @@ -28,7 +30,7 @@ jobs: uses: actions/github-script@v8 with: script: | - // Handle both workflow_run and manual dispatch events + // Handle workflow_run, pull_request, and manual dispatch events let pr; if (context.eventName === 'workflow_run') { @@ -45,6 +47,10 @@ jobs: } pr = pullRequests[0]; + } else if (context.eventName === 'pull_request') { + // Direct PR event + pr = context.payload.pull_request; + } else if (context.eventName === 'workflow_dispatch') { // Get current PR for manual testing const prNumber = context.payload.pull_request?.number || 1101;