Skip to content

Extract workflow scripts from YAML into standalone JS files #38

@jdelfino

Description

@jdelfino

Context

Depends on #37 (shared lib modules).

Each workflow's actions/github-script block contains 190-400 lines of inline JavaScript. This should be extracted into standalone .js files.

Task

  1. Create main script files in .github/agent-workflow/scripts/:

    • guardrail-scope.js
    • guardrail-test-ratio.js
    • guardrail-dependencies.js
    • guardrail-api-surface.js
    • guardrail-commits.js
    • orchestrator-check.js
    • human-review.js
    • pr-context.js
  2. Each file exports module.exports = async function({ github, context, core }) { ... }

  3. Import shared lib modules from ./lib/ instead of duplicating logic

  4. Slim each workflow YAML to a thin shell:

steps:
  - uses: actions/checkout@v4
  - uses: actions/github-script@v7
    with:
      script: |
        const run = require('./.github/agent-workflow/scripts/guardrail-scope.js');
        await run({ github, context, core });

No functional changes — pure extraction refactor.

Files

  • .github/agent-workflow/scripts/*.js (8 new files)
  • .github/workflows/*.yml (8 modified — inline JS replaced with require+run)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions