Skip to content

Conversation

@ghbuck
Copy link

@ghbuck ghbuck commented Oct 25, 2025

✍ Changes

This pull request refactors how runner settings are extracted from workflow files in the SettingsManager class. Instead of relying on regular expressions to parse the runs-on key from workflow YAML, it introduces a more robust method that traverses the YAML object structure directly. This improves reliability and maintainability when reading runner settings.

Runner extraction improvements:

  • Added a new SettingYamlKey enum to define YAML keys, specifically runs-on, for more explicit and type-safe access to workflow settings.
  • Replaced the use of a regular expression for finding runners with a reference to the new SettingYamlKey.runners value in the getSetting method, making the extraction logic clearer and less error-prone.
  • Updated the signature of the getSetting method to accept either a regular expression or a SettingYamlKey, enabling more flexible and context-aware extraction of settings.
  • Refactored the workflow settings extraction logic to use a new method, findInYaml, when a SettingYamlKey is provided, ensuring that YAML keys are searched using object traversal rather than string matching.

New YAML traversal utility:

  • Implemented the findInYaml method, which parses the workflow YAML object by iterative traversal with a stack to locate the specified key and extract runner settings, handling both arrays and single values.

Note

There is a comment in findInYaml about a singular use-case for runs-on specifically. I'm not sure another workflow config key allows for a basic string, a string array, or an object, so perhaps quite the edge case. Either way, it's worth the call out and recognition that if other settings can be this varied, then this section would very much need to be refactored and abstracted.

Documentation:

  • Added @ghbuck to the list of contributors in CONTRIBUTING.md.

📋 Checklist

  • I tested my changes
  • I updated relevant documentation
  • I added myself to the contributors' list

@ghbuck ghbuck changed the title Feature/get setting from yaml Get Setting from workflow.yaml object Oct 25, 2025
@ghbuck ghbuck changed the title Get Setting from workflow.yaml object Get Setting[] from workflow.yaml object Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant