refactor: migrate artifact comment system from repository_dispatch to workflow_run
Some checks failed
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (actions) (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🚦 Security & Quality Gate / 🚑 Expo Doctor Check (push) Has been cancelled
🚦 Security & Quality Gate / 📝 Validate PR Title (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Vulnerable Dependencies (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (check) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (format) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (lint) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (typecheck) (push) Has been cancelled
🕒 Handle Stale Issues / 🗑️ Cleanup Stale Issues (push) Has been cancelled
🤖 Android APK Build (Phone + TV) / 🏗️ Build Android APK (phone) (push) Has been cancelled
🤖 Android APK Build (Phone + TV) / 🏗️ Build Android APK (tv) (push) Has been cancelled
🤖 iOS IPA Build (Phone + TV) / 🏗️ Build iOS IPA (phone) (push) Has been cancelled

Replaces the repository_dispatch event system with workflow_run triggers to improve reliability and reduce complexity. The new approach automatically detects PR associations through commit SHA lookups rather than requiring manual payload construction.

Removes redundant notification steps from build workflows and simplifies the concurrency group logic. Enhances manual testing support with improved PR discovery fallbacks.
This commit is contained in:
Uruk
2025-09-30 00:58:25 +02:00
parent 2b761f15c8
commit 788f420ce5
3 changed files with 61 additions and 203 deletions

View File

@@ -18,7 +18,6 @@ jobs:
name: 🏗️ Build Android APK
permissions:
contents: read
repository-projects: write
strategy:
fail-fast: false
@@ -26,26 +25,6 @@ jobs:
target: [phone, tv]
steps:
- name: 📢 Notify artifact comment workflow (started)
if: github.event_name == 'pull_request'
uses: actions/github-script@v8
with:
script: |
await github.rest.repos.createDispatchEvent({
owner: context.repo.owner,
repo: context.repo.repo,
event_type: 'build-started',
client_payload: {
workflow_name: 'Android APK Build',
target: '${{ matrix.target }}',
status: 'in_progress',
pr_number: ${{ github.event.pull_request.number }},
commit_sha: '${{ github.event.pull_request.head.sha }}',
run_id: ${{ github.run_id }},
run_url: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
}
});
- name: 📥 Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
@@ -112,43 +91,3 @@ jobs:
path: |
android/app/build/outputs/apk/release/*.apk
retention-days: 7
- name: 🔔 Notify artifact comment workflow (success)
if: success() && github.event_name == 'pull_request'
uses: actions/github-script@v8
with:
script: |
await github.rest.repos.createDispatchEvent({
owner: context.repo.owner,
repo: context.repo.repo,
event_type: 'build-completed',
client_payload: {
workflow_name: 'Android APK Build',
target: '${{ matrix.target }}',
status: 'success',
pr_number: ${{ github.event.pull_request.number }},
commit_sha: '${{ github.event.pull_request.head.sha }}',
run_id: ${{ github.run_id }},
run_url: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
}
});
- name: 🔔 Notify artifact comment workflow (failure)
if: failure() && github.event_name == 'pull_request'
uses: actions/github-script@v8
with:
script: |
await github.rest.repos.createDispatchEvent({
owner: context.repo.owner,
repo: context.repo.repo,
event_type: 'build-failed',
client_payload: {
workflow_name: 'Android APK Build',
target: '${{ matrix.target }}',
status: 'failure',
pr_number: ${{ github.event.pull_request.number }},
commit_sha: '${{ github.event.pull_request.head.sha }}',
run_id: ${{ github.run_id }},
run_url: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
}
});