openrewrite / rewrite-github-actions

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

Recipe - Update version of an action #23

Closed yeikel closed 12 months ago

yeikel commented 1 year ago

Example: Update actions/checkout to V3


name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
  Explore-GitHub-Actions:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v2

name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
  Explore-GitHub-Actions:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v3

We should be able to do this with the built in foundational YML recipe but I believe that there is still value in having this pre-configured as it is generic enough

yeikel commented 1 year ago

There are a few similar recipes that I can think of, but I'll wait for your feedback before I create them as it is probably possible to do it with built in recipes

sambsnyd commented 1 year ago

@yeikel I agree this is common enough to be worth having a recipe for

timtebeek commented 12 months ago

After seeing Dependabot open up setup-java@v4 PR one for one, I've picked this up in

Review welcome, and this could also serve as a template for some of your other suggestions @yeikel !