mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-03-06 09:46:17 +00:00
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.
This commit is contained in:
10
.github/workflows/artifact-comment.yml
vendored
10
.github/workflows/artifact-comment.yml
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user