Skip to content

ci: fix TypeError in issue_comment gate, pr was already unwrapped#102

Merged
pappz merged 1 commit intomainfrom
fix/issue-comment-pr-data
Apr 22, 2026
Merged

ci: fix TypeError in issue_comment gate, pr was already unwrapped#102
pappz merged 1 commit intomainfrom
fix/issue-comment-pr-data

Conversation

@pappz
Copy link
Copy Markdown
Contributor

@pappz pappz commented Apr 21, 2026

The response from github.rest.pulls.get is destructured as const { data: pr } = ... on line 102, so pr is already the PR object. Lines 110, 111, and 115 then did pr.data.head.* — double dereference — which crashed with 'Cannot read properties of undefined (reading head)' the first time anyone commented /testflight after PR #97 landed the issue_comment handler.

Description

Summary by CodeRabbit

  • Chores
    • Updated TestFlight workflow configuration for improved internal process handling.

The response from github.rest.pulls.get is destructured as
`const { data: pr } = ...` on line 102, so `pr` is already the PR
object. Lines 110, 111, and 115 then did `pr.data.head.*` — double
dereference — which crashed with 'Cannot read properties of undefined
(reading head)' the first time anyone commented /testflight after
PR #97 landed the issue_comment handler.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5c0dbc23-2b56-486e-99f1-ed9cb92da407

📥 Commits

Reviewing files that changed from the base of the PR and between 658c26c and 65bea06.

📒 Files selected for processing (1)
  • .github/workflows/testflight.yml

📝 Walkthrough

Walkthrough

The TestFlight workflow's issue_comment handling block updates how PR metadata is accessed, changing from the nested pr.data.head path to a direct pr.head path for both repository and SHA references. Control flow and logic remain unchanged.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Update
.github/workflows/testflight.yml
Updated PR metadata property access paths in issue_comment block: changed pr.data.head.repo.full_name to pr.head.repo.full_name for fork detection, and pr.data.head.sha to pr.head.sha for ref output assignment.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through workflows bright,
Fixing paths to get them right,
From data.head to head so clean,
The cleanest GitHub actions seen! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main fix: correcting a double dereference error in the issue_comment handler where pr was being accessed as if it hadn't been unwrapped.
Description check ✅ Passed The description adequately explains the bug (double dereference causing TypeError), provides context (lines affected, when introduced), and clarifies the fix, but the repository's template is minimal and the author's description substantially exceeds it.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-comment-pr-data

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pappz
Copy link
Copy Markdown
Contributor Author

pappz commented Apr 21, 2026

/testflight

@pappz pappz merged commit f82e687 into main Apr 22, 2026
14 checks passed
@pappz pappz deleted the fix/issue-comment-pr-data branch April 22, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants