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

Function buildSecretVerificationContext

actions/setup/js/handle_agent_failure.cjs:2194–2211  ·  view source on GitHub ↗

* For the Copilot engine, adds a suggestion to use `permissions.copilot-requests: write` * to enable Copilot inference through the org without a personal access token. * @param {string} secretVerificationResult - The secret verification result ("failed" or other) * @param {string} engineId - The

(secretVerificationResult, engineId)

Source from the content-addressed store, hash-verified

2192 * @returns {string} Formatted context string, or empty string if verification did not fail
2193 */
2194function buildSecretVerificationContext(secretVerificationResult, engineId) {
2195 if (secretVerificationResult !== "failed") {
2196 return "";
2197 }
2198
2199 let context =
2200 buildWarningAlertLine("Secret Verification Failed", "The workflow's secret validation step failed. Please check that the required secrets are configured in your repository settings.") +
2201 "\nFor more information on configuring tokens, see: https://github.github.com/gh-aw/reference/engines/\n";
2202
2203 if ((engineId || "").toLowerCase() === "copilot") {
2204 context +=
2205 "\n**Alternative**: If your organization has a Copilot subscription, you can avoid the need for a personal access token by adding a top-level `permissions` block to your workflow file. This enables Copilot inference through the org using the built-in GitHub Actions token.\n" +
2206 "\n```yaml\npermissions:\n copilot-requests: write\n```\n" +
2207 "\nSee: https://github.github.com/gh-aw/reference/engines/#github-copilot-default\n";
2208 }
2209
2210 return context;
2211}
2212
2213/**
2214 * Check whether agent-stdio.log contains a terminal_reason: "completed" result entry,

Callers 2

mainFunction · 0.85

Calls 1

buildWarningAlertLineFunction · 0.85

Tested by

no test coverage detected