Actions fails when issues is disabled for the repository
I disabled the Issues feature for multiple repos in one of my orgs to track all issues through a single repository. I still want to sync the labels to use in pull requests though.
As a result of disabling the feature, the job is now failing with the following error message:
{
"message": "Resource not accessible by integration",
"statusCode": 403,
"headers": {
"date": "Wed, 11 Dec 2024 10:56:54 GMT",
"content-type": "application/json; charset=utf-8",
"content-length": "155",
"x-github-media-type": "github.v3; param=symmetra-preview; format=json",
"x-accepted-github-permissions": "issues=write; pull_requests=write",
"x-github-api-version-selected": "2022-11-28",
"x-ratelimit-limit": "15000",
"x-ratelimit-remaining": "14997",
"x-ratelimit-reset": "1733918213",
"x-ratelimit-used": "3",
"x-ratelimit-resource": "core",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
"access-control-allow-origin": "*",
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
"x-frame-options": "deny",
"x-content-type-options": "nosniff",
"x-xss-protection": "0",
"referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"content-security-policy": "default-src 'none'",
"vary": "Accept-Encoding, Accept, X-Requested-With",
"server": "github.com",
"x-github-request-id": "FB51:3E02AA:4810CF:495386:67596FF6"
},
"body": {
"message": "Resource not accessible by integration",
"documentation_url": "https://docs.github.com/rest/issues/labels#add-labels-to-an-issue",
"status": "403"
},
"method": "POST",
"endpoint": "/repos/***/issues/346/labels"
}
If possible, the action should detect that the feature is disabled and not fail or alternatively offer an option to choose what to update (issues, pull request, all, or none).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Reproduction is pretty easy...
- Create an issue
- Add a label to the issue
- Close the issue (optional)
- Disable "Issues" in repository settings (General)
- Execute the workflow
The workflow will fail with the error above
Hi, thanks for reporting this.
I just looked through the issue and yeah, this is something that needs to be fixed in github-label-sync, as you noticed.
Thanks for opening https://github.com/Financial-Times/github-label-sync/issues/188
I'll keep this pinned
@all-contributors please add @Th3S4mur41 for their bug contribution