openrewrite / rewrite-github-actions

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

Replace action name but leave arguments and version untouched #28

Open yeikel opened 1 year ago

yeikel commented 1 year ago

Context:

When working with forks, it is normal to move actions to a different path. This recipe should help to revert this change

Given the following input:


jobs:
  run:
    runs-on: ubuntu
    steps:
      - uses: org/action@version
        with:
         message: 'My Message'

Path: jobs.run.steps[0] New name : MyOrg/OtherName@version


jobs:
  run:
    runs-on: ubuntu
    steps:
      - uses: MyOrg/OtherName@version
        with:
         message: 'My Message'