Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
remove sprintf for prefixing scopes #519
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
base: main
Are you sure you want to change the base?
remove sprintf for prefixing scopes #519
Changes from all commits
dfbf1abFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
GitHub Actions GITHUB_TOKEN fork pull request read-only permissions💡 Result:
For workflows triggered by
pull_requestevents from a fork, GitHub deliberately downgradesGITHUB_TOKENto read-only and does not pass repository secrets (this is not overrideable viapermissions:in the workflow). [1][2]Key implications / options:
GITHUB_TOKENfor fork PR runs onpull_request; GitHub caps it at read-only for safety. [1][2]pull_request_target, which runs in the base repo context and therefore can have read/writeGITHUB_TOKENand access to secrets unless you restrict it—but this is security-sensitive (don’t run untrusted fork code in that context). [1]Sources: GitHub Actions docs on fork PR restrictions and
pull_request_targetbehavior [1], GitHub changelog noting fork PR tokens are always read-only [2], and GitHub settings/policy docs for fork PR workflows in private repos (including “send write tokens”) [3].References:
[1] (docs.github.com)
[2] (github.blog)
[3] (docs.github.com)
Citations:
🌐 Web query:
peaceiris/actions-gh-pages write permissions requirements💡 Result:
To use
peaceiris/actions-gh-pageswithGITHUB_TOKEN, your workflow/job must grant the token write access to repository contents (so it can push commits/tags to the publishing branch, usuallygh-pages). The README explicitly calls out fixing403 Write access to repository not grantedby adding:permissions: contents: write. (github.com)Example:
(github.com)
If you still get “permission denied” errors, also check the repository setting Settings → Actions → General → Workflow permissions and ensure it’s not restricted to read-only (many repos/orgs default to read-only). (stackoverflow.com)
If you deploy to an external repository (
external_repository:),GITHUB_TOKENwon’t work; you must use a deploy key or a personal access token instead. (github.com)Citations:
Guard the deploy job for same-repo PRs.
pull_requestruns from forks receive a read-onlyGITHUB_TOKEN, whichpeaceiris/actions-gh-pages@v4cannot use to push to the repository. This job will fail for external contributors. Add a guard condition to prevent execution on fork PRs:If fork previews are required, use
pull_request_targetin a separate, trusted workflow instead.🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normalize and validate
SCOPE_BASE_REALMbefore defining it.Line 722 uses the raw config value directly. If it is empty or ends with
/, generated scopes can become invalid/mismatched (e.g.,/members/reador...//members/read), which can break auth checks.🔧 Proposed fix
if (!defined('SCOPE_BASE_REALM')) { - define('SCOPE_BASE_REALM', config('app.scope_base_realm')); + $scopeBaseRealm = rtrim((string) config('app.scope_base_realm', ''), '/'); + if ($scopeBaseRealm === '') { + throw new \RuntimeException('Missing required config: app.scope_base_realm'); + } + define('SCOPE_BASE_REALM', $scopeBaseRealm); }🤖 Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.