Fix playwright comment workflow (#2041)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Improves reliability of the Playwright comment workflow by deriving
the PR from the `workflow_run` commit and gating execution accordingly.
>
> - Add `actions/github-script` step to look up PR via
`listPullRequestsAssociatedWithCommit` and expose
`steps.pr.outputs.number`
> - Conditionally skip all subsequent steps when no PR is found; remove
job-level `if`
> - Checkout base branch using `workflow_run.base_ref`; update
`PR_NUMBER` to use the step output
> - Use `types: [completed]` for `workflow_run` and remove
`if-no-artifact-found` options on artifact downloads
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
581369150b84ba4bc6a680f309f78afd399d93ca. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Fixes the Playwright report comment workflow so it reliably posts to the
correct PR, including from forks. Skips cleanly when the CI run isn’t
tied to a PR.
- **Bug Fixes**
- Resolve PR by commit SHA via listPullRequestsAssociatedWithCommit;
works when workflow_run.pull_requests is empty (e.g., forks).
- Add early exit and guard all steps behind a PR check to avoid running
on push/scheduled builds.
- Checkout base_ref and pass the resolved PR number to the summary
comment step.
<sup>Written for commit 581369150b84ba4bc6a680f309f78afd399d93ca.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
正在显示
请
注册
或者
登录
后发表评论