mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 23:59:08 +00:00
fix(ci): improve workflow run condition and artifact collection
Fixes workflow trigger condition by explicitly checking for workflow_run event type to prevent unintended executions. Improves artifact collection reliability by switching to the correct API method and increasing page size to capture more artifacts from multiple builds. Removes redundant artifact fetching logic that was duplicating collection efforts.
This commit is contained in:
13
.github/workflows/artifact-comment.yml
vendored
13
.github/workflows/artifact-comment.yml
vendored
@@ -16,7 +16,7 @@ on:
|
||||
|
||||
jobs:
|
||||
comment-artifacts:
|
||||
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.event == 'pull_request'
|
||||
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request')
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -63,11 +63,11 @@ jobs:
|
||||
console.log(`Processing PR #${pr.number} for commit ${pr.head.sha.substring(0, 7)}`);
|
||||
|
||||
// Get all recent workflow runs for this PR to collect artifacts from multiple builds
|
||||
const { data: workflowRuns } = await github.rest.actions.listWorkflowRuns({
|
||||
const { data: workflowRuns } = await github.rest.actions.listWorkflowRunsForRepo({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
head_sha: pr.head.sha,
|
||||
per_page: 10
|
||||
per_page: 20
|
||||
});
|
||||
|
||||
// Filter for build workflows only
|
||||
@@ -106,13 +106,6 @@ jobs:
|
||||
|
||||
console.log(`Collected ${allArtifacts.length} total artifacts from all builds`);
|
||||
|
||||
// Get artifacts from current run if needed
|
||||
const { data: artifacts } = await github.rest.actions.listWorkflowRunArtifacts({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: runId
|
||||
});
|
||||
|
||||
// Sort and categorize all collected artifacts
|
||||
const androidArtifacts = allArtifacts
|
||||
.filter(a => a.name.includes('android'))
|
||||
|
||||
Reference in New Issue
Block a user