Skip to content

ci: resolve release preview PR from artifact metadata#755

Merged
dianjuar merged 1 commit into
mainfrom
ci/fix-release-preview-pr-resolution
May 30, 2026
Merged

ci: resolve release preview PR from artifact metadata#755
dianjuar merged 1 commit into
mainfrom
ci/fix-release-preview-pr-resolution

Conversation

@dianjuar
Copy link
Copy Markdown
Member

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)

What is the current behavior?

The comment workflow resolves the target PR via listPullRequestsAssociatedWithCommit on workflow_run.head_sha. That is fragile: merge commits can map to the wrong closed PR, and the comment workflow run itself always displays main's SHA (f7e190f), which is easy to misread as posting to the wrong commit.

Issue Number: N/A

What is the new behavior?

  • Preview job stores pr-number.txt alongside comment.md in the artifact.
  • Comment job resolves PR in order: artifact → workflow_run.pull_requests → open PR from head SHA.
  • Logs include the triggering preview run id and head SHA for easier debugging.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Follow-up to #753. Investigated #752 where the comment workflow run showed f7e190f but the preview run used 0402bab.

Test plan

  • Re-run Release preview on an open PR and confirm the bot comment is created/updated on that PR
  • Confirm fork PRs still receive comments after merge to main

Store the PR number in the preview artifact and resolve it there first,
falling back to workflow_run.pull_requests and open PR lookup by head SHA.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions
Copy link
Copy Markdown

Release preview

Simulates squash merge into main using the PR title as the commit message.
Only changes under packages/ngx-deploy-npm affect the version.

PR title: ci: resolve release preview PR from artifact metadata

Semantic commit (PR title)

✅ Valid conventional commit

Version

9.1.09.2.0

Changelog preview

## [9.2.0](https://github.com/bikecoders/ngx-deploy-npm/compare/ngx-deploy-npm-9.1.0...ngx-deploy-npm-9.2.0) (2026-05-30)


### Features

* **ngx-deploy-npm:** extend checkExisting with skip mode and checkTag ([#749](https://github.com/bikecoders/ngx-deploy-npm/issues/749)) ([1250a91](https://github.com/bikecoders/ngx-deploy-npm/commit/1250a9189f46e62e56b03cde76522663c9918467))
* **ngx-deploy-npm:** forward npm publish passthrough flags ([#751](https://github.com/bikecoders/ngx-deploy-npm/issues/751)) ([371751b](https://github.com/bikecoders/ngx-deploy-npm/commit/371751b0f41fac6acb6597d6860ae4a88f86aecc))
* **ngx-deploy-npm:** log post-publish summary with streaming tarball size ([#750](https://github.com/bikecoders/ngx-deploy-npm/issues/750)) ([dbfe288](https://github.com/bikecoders/ngx-deploy-npm/commit/dbfe288a69f52f3749a6d80d4c54ddc87ea8afb0)), closes [#749](https://github.com/bikecoders/ngx-deploy-npm/issues/749)


### Bug Fixes

* **ngx-deploy-npm:** resolve open SonarCloud static analysis issues ([#746](https://github.com/bikecoders/ngx-deploy-npm/issues/746)) ([599ac29](https://github.com/bikecoders/ngx-deploy-npm/commit/599ac2971841cdec6fd720428ed2ae5546492ed5))

Generated by CI (PR Release Preview). Actual release runs on merge via publishment.yml.

Notes: Preview uses only the PR title (squash merge). Changes outside packages/ngx-deploy-npm do not trigger a version bump. Breaking changes must appear in the title (e.g. feat!:), not only in the PR description.

@dianjuar dianjuar merged commit c935254 into main May 30, 2026
31 checks passed
@dianjuar dianjuar deleted the ci/fix-release-preview-pr-resolution branch May 30, 2026 20:33
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.

1 participant