Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Resource not accessible by integration #188

Open
Th3S4mur41 opened this issue Jan 2, 2025 · 0 comments
Open

Bug: Resource not accessible by integration #188

Th3S4mur41 opened this issue Jan 2, 2025 · 0 comments

Comments

@Th3S4mur41
Copy link

What

Running label sync with "Issues" disabled in the repository settings fails with the following error:

{
	"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"
}

Details

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
  6. The workflow will fail with the error above

It seems that the GitHub API is still returning the issues, even with the feature disabled, but no longer allows changes to them.

If possible, the script should detect that the feature is disabled and not fail.
Alternatively offer an option to choose what to update (issues, pull request, all, or none).

Additional information

Initially filed for label-sync action.
This cannot be solved in the action without a fix here first though

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

No branches or pull requests

1 participant