Skip to content

[task] Extract sanitizeWorkflowName to dedicated helper file #3134

@github-actions

Description

@github-actions

Objective

Extract the sanitizeWorkflowName function from pkg/workflow/js/parse_firewall_logs.cjs to its own dedicated helper file.

Context

The sanitizeWorkflowName function in parse_firewall_logs.cjs is a utility that could be reused. Following the pattern of "1 javascript helper per file so that they can be imported one by one", this should be extracted to its own module. Part of issue #3119.

Approach

  1. Create new file: pkg/workflow/js/sanitize_workflow_name.cjs
  2. Move the sanitizeWorkflowName function to the new file
  3. Export the function as a CommonJS module: module.exports = { sanitizeWorkflowName };
  4. Update pkg/workflow/js/parse_firewall_logs.cjs to import: const { sanitizeWorkflowName } = require('./sanitize_workflow_name.cjs');
  5. Remove the function definition from parse_firewall_logs.cjs

Files to Modify

  • Create: pkg/workflow/js/sanitize_workflow_name.cjs (new helper file)
  • Update: pkg/workflow/js/parse_firewall_logs.cjs (import and remove definition)

Acceptance Criteria

AI generated by Plan Command for #3119

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions