DEV Community

Cover image for Keep your Gradle Wrapper up-to-date! 🤖
Cristian Greco
Cristian Greco

Posted on

Keep your Gradle Wrapper up-to-date! 🤖

My Workflow

Are you using Gradle Wrapper in your project? How often do you update it?

Maintaining dependencies up-to-date is regarded as a good practice, and the build system files should be no exception!

The Update Gradle Wrapper Action aims to help keeping Gradle projects on GitHub polished to high standards and to strengthen the software supply chain in the Gradle ecosystem.

As soon as a new Gradle release is available, this action will open a PR to update your Wrapper files.

Check it out now: gradle-update/update-gradle-wrapper-action

Pull Request

How to use it

Just create a new workflow file .github/workflows/update-gradle-wrapper.yml and paste this:

name: Update Gradle Wrapper

on:
  schedule:
    - cron: "0 0 * * *"

jobs:
  update-gradle-wrapper:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Update Gradle Wrapper
      uses: gradle-update/update-gradle-wrapper-action@v1
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
Enter fullscreen mode Exit fullscreen mode

Submission Category:

Maintainer Must-Haves

Link to Code

GitHub logo gradle-update / update-gradle-wrapper-action

Keep Gradle Wrapper up-to-date with this action.

Update Gradle Wrapper Action

CI

This action keeps the Gradle Wrapper script in your projects up-to-date to the latest release.

Schedule an automatic daily or weekly workflow: as soon as a new Gradle release is available, the action will open a PR ready to be merged. It's like Dependabot for Gradle Wrapper. 🤖

Pull Request

Table of Contents

Usage

Create a new dedicated workflow file:

.github/workflows/update-gradle-wrapper.yml

Paste this configuration:

name: Update Gradle Wrapper
on
  schedule
    - cron: "0 0 * * *"

jobs:
  update-gradle-wrapper:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Update Gradle Wrapper
        uses: gradle-update/update-gradle-wrapper-action@v1
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
Enter fullscreen mode Exit fullscreen mode

The action will run every day around…

Additional Resources / Info

Check the detailed description of action inputs and some more usage examples.

Top comments (0)