Skip to content

Skip Post Publish Notification for PR builds - #2053

Merged
lbussell merged 2 commits into
dotnet:mainfrom
lbussell:fix-publish-pr
Mar 30, 2026
Merged

lbussell merged 2 commits into
dotnet:mainfrom
lbussell:fix-publish-pr

Conversation

@lbussell

Copy link
Copy Markdown
Member

The Post Publish Notification step in the Publish stage fails with a NullReferenceException on PR builds (example).

Root cause: The Create Manifest Lists step in post-build.yml is skipped for PR builds (ne(variables['Build.Reason'], 'PullRequest')) because it requires registry access. Without that step, manifest digests in image-info.json are null. The postPublishNotification command then crashes when it tries to read those digests.

This was introduced by #2030 (moved manifest list creation to Post_Build) and activated by #2038 (updated the ImageBuilder tag to include that change).

Fix: Add ne(variables['Build.Reason'], 'PullRequest') to the Post Publish Notification condition, consistent with how Create Manifest Lists handles PR builds.

Manifest list digests are not populated in PR builds because the
Create Manifest Lists step is skipped (see post-build.yml). Without
those digests, postPublishNotification fails with a NullReferenceException
when reading image-info.json.

Co-authored-by: Copilot <[email protected]>
@lbussell
lbussell requested a review from a team as a code owner March 30, 2026 20:18
@lbussell
lbussell enabled auto-merge (squash) March 30, 2026 20:18
@lbussell
lbussell merged commit 3b6b71f into dotnet:main Mar 30, 2026
20 checks passed
@lbussell
lbussell deleted the fix-publish-pr branch March 30, 2026 22:45
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