Skip to content

ci: test pr-cancel for liuyifei#58

Merged
317787106 merged 2 commits into317787106:developfrom
liuyifei001:hotfix/ci_3
Mar 20, 2026
Merged

ci: test pr-cancel for liuyifei#58
317787106 merged 2 commits into317787106:developfrom
liuyifei001:hotfix/ci_3

Conversation

@liuyifei001
Copy link
Copy Markdown

@liuyifei001 liuyifei001 commented Mar 20, 2026

What does this PR do?

Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details


Summary by cubic

Run the cancel workflow only when a PR is closed without being merged by switching to the pull_request_target closed event and adding if: github.event.pull_request.merged == false. This stops cancellations after merge and makes the job more reliable.

  • Bug Fixes
    • Use pull_request_target on closed to run in the target repo context.
    • Replace github.paginate(...listWorkflowRuns...) with listWorkflowRuns and iterate over data.workflow_runs to avoid run listing issues.

Written for commit 848ed1b. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Improved PR workflow efficiency: cancellation now only targets CI runs for unmerged pull requests, reducing unnecessary job cancellations.
    • Improved matching of workflow runs to ensure only the intended pipeline executions are canceled.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 20, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 58a7b16a-31d4-4b07-a2ac-a9d7e9c2151c

📥 Commits

Reviewing files that changed from the base of the PR and between 2263f80 and 848ed1b.

📒 Files selected for processing (1)
  • .github/workflows/pr-cancel.yml

📝 Walkthrough

Walkthrough

Updated the PR cancellation workflow: changed the workflow trigger to pull_request_target, added a job-level conditional to run cancel only for closed-but-not-merged PRs, and replaced pagination with a direct listWorkflowRuns call iterating data.workflow_runs while keeping existing cancellation matching logic.

Changes

Cohort / File(s) Summary
PR Cancellation Workflow
.github/workflows/pr-cancel.yml
Switched workflow trigger from pull_request to pull_request_target; added job if: github.event.pull_request.merged == false; replaced github.paginate(...) with github.rest.actions.listWorkflowRuns(...) and iterated data.workflow_runs; preserved cancellation matching by head_sha and pull request number.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hop through workflows, gentle and spry,
I skip the merged ones with a wink of my eye.
I list runs and cancel those left behind,
A tidy CI garden, neat and kind. 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'ci: test pr-cancel for liuyifei' is vague and does not clearly describe the actual change made to the codebase. Revise the title to clearly describe the main change, such as 'ci: skip pr-cancel job when pull request is merged' or 'ci: add merged condition to pr-cancel workflow'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

Tip

CodeRabbit can generate a title for your PR based on the changes.

Add @coderabbitai placeholder anywhere in the title of your PR and CodeRabbit will replace it with a title based on the changes in the PR. You can change the placeholder by changing the reviews.auto_title_placeholder setting.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

@liuyifei001 liuyifei001 reopened this Mar 20, 2026
@liuyifei001 liuyifei001 reopened this Mar 20, 2026
@317787106 317787106 merged commit ffa328f into 317787106:develop Mar 20, 2026
21 of 32 checks passed
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