ci: find fork pull requests by head branch when deploying previews - #872
Merged
Merged
Conversation
Co-Authored-By: Mattias Buelens <mattias.buelens@dolby.com>
MattiasBuelens
requested review from
Jeroen-Veltmans and
jeroentempels-dolby
September 18, 2026 11:21
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
jeroentempels-dolby
approved these changes
Sep 18, 2026
This comment has been minimized.
This comment has been minimized.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The first fork preview run after #871 failed in
Find pull request for commit(https://github.com/THEOplayer/documentation/actions/runs/35339031902):GET /repos/{repo}/commits/{sha}/pullsreturns an empty list when the commit only exists in the fork, so no pull request was found for #870.Look up the pull request by head branch instead, and keep the same safety checks:
HEAD_OWNER/HEAD_BRANCHcome fromworkflow_run.head_repository.owner.login/workflow_run.head_branch. The result is still required to match the exactworkflow_run.head_shaand head repository, so a fork cannot get its artifact deployed under another pull request's number. Verified the query against #870 locally: returns870.Link to Devin session: https://dolby.devinenterprise.com/sessions/d49785eb74de44dfbe2baeafe9b73728
Open in Devin Desktop: https://dolby.devinenterprise.com/desktop/session/d49785eb74de44dfbe2baeafe9b73728?variant=devin
Requested by: @MattiasBuelens