Skip to content

[Safe Outputs Conformance] USE-001: approve_workflow_run.cjs errors missing standardized error codes #54171

Description

@github-actions

Conformance Check Failure

Check ID: USE-001
Severity: LOW
Category: Usability

Problem Description

The Error Code Standardization check (USE-001) flags actions/setup/js/approve_workflow_run.cjs: it throws errors on GitHub API failures but doesn't tag them with one of the spec's standardized error codes (E001-E010).

Three throw sites are affected, all corresponding to GitHub API call failures, which map to E007 (API_ERROR) per the spec's error code catalog:

// getModifiedPullRequestFiles()
throw new Error(`Unable to verify modified files for pull request #${pullRequestNumber}`);

// isForkPullRequest()
throw new Error(`Cannot approve pull request #${pullRequestNumber}: its fork repository is unavailable`);
throw new Error(`Unable to verify fork status for pull request #${pullRequestNumber}`);

Affected Components

  • Files: actions/setup/js/approve_workflow_run.cjs
  • Handlers: approve_workflow_run
🔍 Current vs Expected Behavior

Current Behavior

Errors thrown from getModifiedPullRequestFiles() and isForkPullRequest() use plain, unprefixed messages with no standardized error code, making them harder to correlate with the spec's error catalog or filter/handle programmatically downstream.

Expected Behavior

Per spec Section 9.5 (Error Code Catalog), thrown errors originating from failed/unusable GitHub API responses should be prefixed with their catalog code, e.g. E007: Unable to verify modified files for pull request #123, consistent with other handlers in the codebase (see SEC-007/EH1 pre-API validation checks).

Remediation Steps

This task can be assigned to a Copilot coding agent with the following steps:

  1. In actions/setup/js/approve_workflow_run.cjs, prefix the three throw new Error(...) messages in getModifiedPullRequestFiles() and isForkPullRequest() with E007: (API_ERROR), following the format used elsewhere in the codebase (see E007 (API_ERROR) usage patterns in other handlers under actions/setup/js/).
  2. Update or add assertions in actions/setup/js/approve_workflow_run.test.cjs to check the thrown error messages include the E007 prefix.
  3. Re-run the conformance checker to confirm USE-001 passes for this file.

Verification

After remediation, verify the fix by running:

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

The check USE-001 should pass without errors for approve_workflow_run.cjs.

References

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

Generated by ✅ Daily Safe Outputs Conformance Checker · agent · 53.8 AIC · ⌖ 7.05 AIC · ⊞ 7K ·

  • expires on Aug 20, 2026, 9:54 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