Skip to content

Avoid validate workflow failures on forked pull requests#2950

Draft
vijaysaayi with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-failing-github-actions-job
Draft

Avoid validate workflow failures on forked pull requests#2950
vijaysaayi with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-failing-github-actions-job

Conversation

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

The validate job was failing after successful SHA checks because the summary step always attempted to post a PR comment. On forked pull_request runs, that write uses a read-only token and fails with Resource not accessible by integration.

  • Summary publishing

    • Move the SHA validation report to the job summary unconditionally via core.summary.
    • Keep the existing summary content and per-stack status output intact.
  • Fork-safe PR commenting

    • Detect whether the PR head repo differs from the base repo.
    • Only post an issue comment for same-repo PRs.
    • Skip comment creation for forked PRs instead of failing the job.
  • Failure semantics

    • Preserve the existing behavior where the job still fails if PHP or .NET SHA validation fails.
    • Limit the change to the reporting path; validation logic itself is unchanged.
const pullRequest = context.payload.pull_request;
const isFork = pullRequest?.head?.repo?.full_name !== pullRequest?.base?.repo?.full_name;

await core.summary.addRaw(body, true).write();

if (!isFork && context.issue.number) {
  await github.rest.issues.createComment({ ... });
}

Copilot AI changed the title [WIP] Fix failing GitHub Actions job validate Avoid validate workflow failures on forked pull requests Jul 9, 2026
Copilot AI requested a review from vijaysaayi July 9, 2026 09:09
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