[PR #7364] [MERGED] fix(ci): pick up owner approval on pull requests from forks #7699

Closed
opened 2026-10-24 04:06:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7364
Author: @SpicyMarinara
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/owner-approval-forks


📝 Commits (1)

  • e13392c fix(ci): pick up owner approval on pull requests from forks

📊 Changes

3 files changed (+15 additions, -0 deletions)

View changed files

📝 .github/workflows/owner-approval-review.yml (+12 -0)
📝 CHANGELOG.md (+1 -0)
📝 scripts/validate-pr-triage.mjs (+2 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7363

Why this change

  • When SpicyMarinara approves a PR opened from a fork, the required Owner approval for outside contributors status never updates. On 2026-10-09, #7317 and #7314 stayed blocked after approval. They only turned green after their Pull Request Triage runs were rerun by hand.
  • Cause: Owner Approval Review Evaluator looks for the PR in workflow_run.pull_requests and then in GET /commits/{sha}/pulls. Both are empty for a commit that lives only in a fork. The step logged "not associated with a pull request" and skipped publishing.

What changed

  • .github/workflows/owner-approval-review.yml: when both lookups are empty, the evaluator pages through this repository's open PRs. It keeps the one whose head SHA equals the reviewed commit. Nothing from the fork is read: no head_repository, branch name or checkout, so the hardening that validate-pr-triage.mjs pins still holds. No match still means no status. The approval itself is still evaluated by the trusted scripts/evaluate-owner-approval.mjs from the default branch.
  • scripts/validate-pr-triage.mjs: one new assertion pins the head-SHA fallback. No existing assertion changed.
  • CHANGELOG entry for contributors.

The evaluator is a workflow_run workflow, so it runs from the default branch. This fix takes effect once it reaches main. Until then, rerunning a fork PR's Pull Request Triage after approving still works as a workaround.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • After this reaches main, manually verify that approving a fork PR turns Owner approval for outside contributors green without rerunning triage.
  • Manually verify that approving a same-repository PR still updates the status as before.

Agent-run checks:

  • node scripts/validate-pr-triage.mjs passes.
  • A dry run of the step's script with a fake github object returned the right PR in all three cases:
    • a fork PR, matched by head SHA, gave 7317
    • no match gave no output and the notice
    • the existing commit lookup gave 7400

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

None: CI workflow only.

Summary by CodeRabbit

  • Bug Fixes
    • The owner approval check now correctly identifies open pull requests from forks when the workflow can’t find them through its usual lookup. After a maintainer approves, the check can turn green without rerunning PR triage.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7364 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/owner-approval-forks` --- ### 📝 Commits (1) - [`e13392c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e13392c3323b267f5b50b860b3fe870318becf7f) fix(ci): pick up owner approval on pull requests from forks ### 📊 Changes **3 files changed** (+15 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/owner-approval-review.yml` (+12 -0) 📝 `CHANGELOG.md` (+1 -0) 📝 `scripts/validate-pr-triage.mjs` (+2 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7363 ## Why this change - When SpicyMarinara approves a PR opened from a fork, the required **Owner approval for outside contributors** status never updates. On 2026-10-09, #7317 and #7314 stayed blocked after approval. They only turned green after their **Pull Request Triage** runs were rerun by hand. - Cause: **Owner Approval Review Evaluator** looks for the PR in `workflow_run.pull_requests` and then in `GET /commits/{sha}/pulls`. Both are empty for a commit that lives only in a fork. The step logged "not associated with a pull request" and skipped publishing. ## What changed - `.github/workflows/owner-approval-review.yml`: when both lookups are empty, the evaluator pages through this repository's open PRs. It keeps the one whose head SHA equals the reviewed commit. Nothing from the fork is read: no `head_repository`, branch name or checkout, so the hardening that `validate-pr-triage.mjs` pins still holds. No match still means no status. The approval itself is still evaluated by the trusted `scripts/evaluate-owner-approval.mjs` from the default branch. - `scripts/validate-pr-triage.mjs`: one new assertion pins the head-SHA fallback. No existing assertion changed. - CHANGELOG entry for contributors. The evaluator is a `workflow_run` workflow, so it runs from the default branch. This fix takes effect once it reaches `main`. Until then, rerunning a fork PR's **Pull Request Triage** after approving still works as a workaround. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - After this reaches `main`, manually verify that approving a fork PR turns **Owner approval for outside contributors** green without rerunning triage. - Manually verify that approving a same-repository PR still updates the status as before. Agent-run checks: - `node scripts/validate-pr-triage.mjs` passes. - A dry run of the step's script with a fake `github` object returned the right PR in all three cases: - a fork PR, matched by head SHA, gave `7317` - no match gave no output and the notice - the existing commit lookup gave `7400` ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) None: CI workflow only. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * The owner approval check now correctly identifies open pull requests from forks when the workflow can’t find them through its usual lookup. After a maintainer approves, the check can turn green without rerunning PR triage. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:06:39 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7699
No description provided.