Skip to content

[Safe Outputs Conformance] USE-001: Use a standardized error code in safe_outputs_bootstrap.cjs runtime-policy error #44675

Description

@github-actions

Conformance Check Failure

Check ID: USE-001
Severity: LOW
Category: Usability (Error Code Standardization)

Problem Description

The USE-001 conformance check flags actions/setup/js/safe_outputs_bootstrap.cjs for throwing an error without a standardized error code. In enforceCreatePullRequestRuntimePolicy, startup is refused when runtime policy disables create-pull-request:

const message = `create-pull-request is disabled by runtime policy: ${policyVarName}=false. ` +
  `Remove safe-outputs.create-pull-request or set ${policyVarName}=true.`;
logger.debugError(message);
throw new Error(message);

The thrown message carries no standardized E### / ERR_ code, unlike sibling handlers that use the shared codes in actions/setup/js/error_codes.cjs. Standardized codes make failures greppable in logs and consistent across handlers.

Affected Components

  • Files: actions/setup/js/safe_outputs_bootstrap.cjs (function enforceCreatePullRequestRuntimePolicy, ~line 71)
  • Reference module: actions/setup/js/error_codes.cjs
🔍 Current vs Expected Behavior

Current Behavior

The runtime-policy refusal throws a bare Error(message) with no standardized code prefix.

Expected Behavior

Handlers that throw or setFailed should prefix the message with a standardized error code from error_codes.cjs (e.g. an ERR_* constant), so USE-001 reports PASS.

Remediation Steps

Suitable for a Copilot coding agent:

  1. Review actions/setup/js/error_codes.cjs and select (or add, following the existing convention) an appropriate code for a runtime-policy refusal.
  2. Require it in safe_outputs_bootstrap.cjs and prefix the thrown message, e.g. throw new Error(\${ERR_POLICY}: ${message}`);`.
  3. Confirm no callers pattern-match on the exact current message text.

Verification

After remediation, verify the fix by running:

bash scripts/check-safe-outputs-conformance.sh

Check USE-001 should report PASS and the summary's Low Failures count should decrease.

References

  • Safe Outputs Specification: docs/src/content/docs/specs/safe-outputs-specification.md
  • Conformance Checker: scripts/check-safe-outputs-conformance.sh
  • Run ID: 29074992976
  • Date: 2026-07-10

Generated by ✅ Daily Safe Outputs Conformance Checker · 54.6 AIC · ⌖ 8.45 AIC · ⊞ 6.6K ·

  • expires on Jul 10, 2026, 10:59 PM UTC-08:00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions