label-sync icon indicating copy to clipboard operation
label-sync copied to clipboard

Actions fails when issues is disabled for the repository

Open Th3S4mur41 opened this issue 1 year ago • 5 comments

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).

Th3S4mur41 avatar Dec 11 '24 11:12 Th3S4mur41

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.

github-actions[bot] avatar Dec 31 '24 17:12 github-actions[bot]

Reproduction is pretty easy...

  1. Create an issue
  2. Add a label to the issue
  3. Close the issue (optional)
  4. Disable "Issues" in repository settings (General)
  5. Execute the workflow

The workflow will fail with the error above

Th3S4mur41 avatar Jan 02 '25 10:01 Th3S4mur41

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

EndBug avatar Jan 02 '25 10:01 EndBug

@all-contributors please add @Th3S4mur41 for their bug contribution

EndBug avatar Jan 02 '25 10:01 EndBug

@EndBug

I've put up a pull request to add @Th3S4mur41! :tada:

allcontributors[bot] avatar Jan 02 '25 10:01 allcontributors[bot]