openrewrite / rewrite-github-actions

OpenRewrite recipes for performing GitHub action hygiene and migration tasks.
Apache License 2.0
9 stars 10 forks source link

Generic recipe to Update existing command #34

Open yeikel opened 1 year ago

yeikel commented 1 year ago

The recipes

are trying to accomplish the same: Given an existing step/command, provide a recipe to update/replace the existing value

Can we create a generic recipe to cover both scenarios?

We can still leave them as templates but this recipe should have most of the logic for them

timtebeek commented 3 months ago

We recently added the concept of traits to our recipe authoring experience, which could be a good match here to match any line that contains a command, and apply a transformation that then gets written back out again. That ought to reduce these referenced recipes to mostly wrappers around that matcher with a display name and description, but barely any logic.