Skip to content

[QA-215] fix(ci): stop thank-you-note workflow failing on merged PRs - #16576

Open
nihal467 wants to merge 2 commits into
developfrom
fix/thank-you-note-checkout
Open

[QA-215] fix(ci): stop thank-you-note workflow failing on merged PRs#16576
nihal467 wants to merge 2 commits into
developfrom
fix/thank-you-note-checkout

Conversation

@nihal467

@nihal467 nihal467 commented Jul 16, 2026

Copy link
Copy Markdown
Member

Proposed Changes

Fixes the Thank You Note Generator workflow failing on every merged PR (e.g. run 29501202990 on #16569).

Symptom: The job fails at the Checkout PR branch step:

fatal: couldn't find remote ref refs/heads/QA-210-allow-qa-key-in-pr-title-jira-validation
failed to run git: exit status 128

Root cause: The workflow triggers on pull_request_target: closed. When a PR is merged, its head branch is typically deleted, so checkout_pr_branch.cjs cannot find the ref and hard-fails, aborting the job before the agent posts the thank-you note — defeating the workflow's entire purpose.

Fix: A single continue-on-error: true on the Checkout PR branch step. The checkout is not required for posting the note (the agent reads PR metadata via the API), and the downstream checkout_pr_success output already defaults to 'true', so the job proceeds and the note is posted.

       - name: Checkout PR branch
         id: checkout-pr
+        continue-on-error: true
         if: |
           github.event.pull_request

Scope: 3 lines added to the generated lock file; nothing else touched.

  • I have gone through the CONTRIBUTING guidelines.

@ohcnetwork/care-fe-code-reviewers

Summary by CodeRabbit

  • Bug Fixes
    • Improved automated thank-you note posting for merged or closed pull requests whose source branches have been deleted.

The Thank You Note Generator triggers on pull_request_target: closed. When
a PR is merged, its head branch is usually deleted, so the pre-agent
"Checkout PR branch" step failed with 'couldn't find remote ref', aborting
the job before the agent could post the thank-you note.

Recompile with the current gh-aw (v0.77.5). Its checkout_pr_branch.cjs
detects the closed/merged PR and treats the deleted-branch checkout as a
warning (checkout_pr_success=true, no setFailed) instead of a hard error,
so the workflow proceeds and posts the note. Only the generated lock file
changes; the workflow source is unchanged.
@nihal467
nihal467 requested review from a team and Copilot July 16, 2026 13:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Changes

Thank-you note workflow

Layer / File(s) Summary
Allow checkout failures
.github/workflows/thank-you-note.lock.yml
The PR branch checkout step now continues on error when the head branch is unavailable, allowing the workflow to proceed to posting the thank-you note.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the workflow fix for merged PRs and is concise.
Description check ✅ Passed The description covers the proposed change, root cause, fix, and scope, with only the template's exact issue reference and checklist partially incomplete.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/thank-you-note-checkout

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

@github-actions

Copy link
Copy Markdown

⚠️ Merge Checklist Incomplete

Thank you for your contribution! To help us review your PR efficiently, please complete the merge checklist in your PR description.

Your PR will be reviewed once you have marked the appropriate checklist items.

To update the checklist:

  • Change - [ ] to - [x] for completed items
  • Only check items that are relevant to your PR
  • Leave items unchecked if they don't apply

The checklist helps ensure code quality, testing coverage, and documentation are properly addressed.

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

🎭 Playwright Test Results

Status: ⏭️ Skipped

No test-related files were changed in this PR.

Tests are skipped when changes don't affect:

  • tests/**
  • src/**
  • package.json
  • playwright.config.ts

Run: #10277

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploying care-preview with  Cloudflare Pages  Cloudflare Pages

Latest commit: a3fd552
Status: ✅  Deploy successful!
Preview URL: https://61f088b1.care-preview-a7w.pages.dev
Branch Preview URL: https://fix-thank-you-note-checkout.care-preview-a7w.pages.dev

View logs

@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes the Thank You Note Generator workflow aborting on every merged PR because the old checkout_pr_branch.cjs (gh-aw v0.42.14) called setFailed when it couldn't check out the already-deleted head branch, killing the job before the agent could post any note.

  • Adds continue-on-error: true to the "Checkout PR branch" step so a failed git checkout (expected when the branch is deleted on merge) is treated as a non-fatal warning and the agent job continues normally.
  • The existing checkout_pr_success output already defaults to 'true' via the || 'true' fallback when the step produces no output, so the downstream handle_agent_failure step in conclusion will not misinterpret this expected failure as a real error.

Confidence Score: 5/5

Safe to merge — a minimal, targeted change that lets the agent job continue past a git checkout failure that is expected on every merged PR.

The fix is a single continue-on-error: true directive on the one step known to abort when a merged PR's branch is deleted. The checkout_pr_success output already has a || 'true' fallback that correctly represents 'checkout skipped, proceed anyway' to downstream jobs. No logic changes, no new secrets, no permission changes.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/thank-you-note.lock.yml Adds continue-on-error: true to the "Checkout PR branch" step so the agent job doesn't abort when the head branch has been deleted after merging. Also adds an explanatory comment. No other changes.

Reviews (2): Last reviewed commit: "simplify: use continue-on-error instead ..." | Re-trigger Greptile

Revert the v0.77.5 recompile churn; the failure is fixed with a single continue-on-error on the Checkout PR branch step so merged PRs (deleted head branch) no longer fail the job.
Copilot AI review requested due to automatic review settings July 16, 2026 13:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/thank-you-note.lock.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/thank-you-note.lock.yml:
- Around line 114-116: The checkout step in the thank-you workflow must not
blanket-suppress failures via continue-on-error. Update the checkout and
checkout_pr_success handling so only an expected deleted head branch is treated
as successful, while authentication, API, network, and other checkout failures
propagate or stop downstream execution; do not allow missing step output to
default to success.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 60ab9f3d-24b1-4134-930a-2ed291c9c8f5

📥 Commits

Reviewing files that changed from the base of the PR and between 83d48a0 and a3fd552.

📒 Files selected for processing (1)
  • .github/workflows/thank-you-note.lock.yml

Comment thread .github/workflows/thank-you-note.lock.yml
@nihal467 nihal467 changed the title fix(ci): stop thank-you-note workflow failing on merged PRs [QA-215] fix(ci): stop thank-you-note workflow failing on merged PRs Jul 16, 2026
@nihal467

Copy link
Copy Markdown
Member Author

Filed upstream tracking issue: github/gh-aw#46768.

Summary of why this PR keeps the continue-on-error: true workaround instead of a "cleaner" fix:

  • checkout: false in frontmatter doesn't help. It only disables the default actions/checkout at job start, not the PR-specific Checkout PR branch step (which uses actions/github-script + checkout_pr_branch.cjs). gh-aw currently has no flag to skip that step.
  • Regenerating with gh aw compile isn't viable in-scope. The locally-installed gh-aw is v0.77.5 vs the v0.42.14 that produced the current lock file, so recompilation adds ~500 lines of unrelated framework churn and still emits the same failing step.
  • Manually deleting the step from the lock file is fragile — the next gh aw compile silently reintroduces it.

The one-line continue-on-error: true patch is the lowest-friction fix that survives future regenerations (any upgrade would have to actively remove the attribute). Once the upstream issue is addressed, this workaround can be dropped in a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants