MCPcopy Create free account
hub / github.com/github/gh-aw / buildWorkflowsScopeError

Function buildWorkflowsScopeError

actions/setup/js/push_to_pull_request_branch.cjs:221–229  ·  view source on GitHub ↗

* Builds the typed result and logs actionable guidance when a branch push fails * because the token lacks the 'workflows' scope. * * @param {string} context - Short label identifying the push path (e.g. "Review branch", "Fallback branch") * @param {typeof core} coreLogger - Actions core logger

(context, coreLogger)

Source from the content-addressed store, hash-verified

219 * @returns {{ success: false, error_type: "workflows_scope_required", error: string }}
220 */
221function buildWorkflowsScopeError(context, coreLogger) {
222 coreLogger.error(`${context} push rejected: the branch includes changes to workflow files (.github/workflows/**) that require the 'workflows' scope on the push token.`);
223 coreLogger.error("To allow this workflow to push workflow file changes, configure 'push-to-pull-request-branch.allow-workflows: true' together with a GitHub App in 'safe-outputs.github-app'.");
224 return {
225 success: false,
226 error_type: "workflows_scope_required",
227 error: `${context} push rejected: the branch includes changes to workflow files (.github/workflows/**) requiring the 'workflows' scope. The token used for the safe-outputs checkout does not have this scope. Fix: configure 'push-to-pull-request-branch.allow-workflows: true' with a GitHub App in 'safe-outputs.github-app', or exclude workflow files from the changeset.`,
228 };
229}
230
231/**
232 * Main handler factory for push_to_pull_request_branch

Callers 2

mainFunction · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected