Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 25, 2025

The broken-changes workflow fails for external contributors with "Resource not accessible by integration" because GITHUB_TOKEN lacks write permissions for fork PRs.

Changes

  • Added conditional to skip comment posting for fork PRs: github.event.pull_request.head.repo.full_name == github.repository
  • Preserved always() to run regardless of prior step failures
  • Added inline comment explaining the fork permission constraint

Behavior

  • Internal PRs: gorelease analysis runs → comment posted
  • Fork PRs: gorelease analysis runs → comment skipped (no error)
  • Analysis output remains visible in "Print API changes" step for all PRs
Original prompt

This section details on the original issue you should resolve

<issue_title>bug: broken-changes action alway failed for external contributors</issue_title>
<issue_description># Bug Report

Current behavior:

broken-changes actions failled.

Run marocchino/sticky-pull-request-comment@v2
  with:
    path: changes.txt
    GITHUB_TOKEN: ***
    header: gorelease
    append: false
    recreate: false
    delete: false
    only_create: false
    only_update: false
    hide_details: false
    hide: false
    hide_and_recreate: false
    hide_classify: OUTDATED
    ignore_empty: false
    skip_unchanged: false
    follow_symbolic_links: false
  env:
    GO111MODULE: on
Error: Resource not accessible by integration - https://docs.github.com/rest/issues/comments#create-an-issue-comment

Failed actions example

Expected behavior:

No errors.
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Oct 25, 2025
@github-actions
Copy link

summary

Base version: v3.117.2-0.20251024101740-fda5a9d2c204 (master)
Cannot suggest a release version.
Can only suggest a release version when compared against the most recent version of this major: v3.117.1.

Copilot AI changed the title [WIP] Fix broken-changes action for external contributors Fix broken-changes action for fork PRs Oct 25, 2025
Copilot AI requested a review from asmyasnikov October 25, 2025 09:23
Copilot finished work on behalf of asmyasnikov October 25, 2025 09:23
@asmyasnikov asmyasnikov requested a review from Copilot October 25, 2025 10:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a permissions issue where the broken-changes workflow fails when external contributors open pull requests from forks, preventing the "Resource not accessible by integration" error.

  • Adds conditional logic to skip posting comments for fork PRs while preserving gorelease analysis
  • Maintains always() execution guarantee for internal PRs
  • Documents the fork permission constraint with an inline comment

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

bug: broken-changes action alway failed for external contributors

2 participants