Giter Club home page Giter Club logo

Comments (1)

Qu4tro avatar Qu4tro commented on May 25, 2024

I had the same problem. Here's my solution:

pre-commit-dependencies-2:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/[email protected]

    - run:  pre-commit autoupdate

    - run: git diff > changes.patch
    - uses: actions/[email protected]
      with:
        name: patch2
        path: changes.patch

github-actions-dependencies-3:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/[email protected]

    - name: Run GitHub Actions Version Updater
      continue-on-error: true
      uses: saadmk11/[email protected]
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        skip_pull_request: true

    - run: git diff > changes.patch
    - uses: actions/[email protected]
      with:
        name: patch3
        path: changes.patch

commit-push:
  needs:
    - pre-commit-dependencies-2
    - github-actions-dependencies-3
  runs-on: ubuntu-latest
  steps:
    - uses: actions/[email protected]
    - uses: actions/[email protected]

    - run: |
        for i in 2 3; do
          git apply --allow-empty "patch${i}/changes.patch"
          rm -rf "patch${i}"
        done

    - name: Create Pull Request
      uses: peter-evans/[email protected]
      with:
          token: ${{ secrets.GITHUB_TOKEN }} 
          branch: update/github-actions
          title: "chore: update github actions to latest version"
          commit-message: "chore: update github action"
          body: Update versions of github actions to latest version.

cleanup-artifacts:
  needs: commit-push
  runs-on: ubuntu-latest
  steps:
    - name: Delete all artifacts
      uses: geekyeggo/delete-artifact@v2
      with:
        name: |
          patch*

I had to remove some stuff from my actual workflow, but hopefully I didn't fuck it up.

In essence, each job takes care of one type of update. In this case a job for github-actions-version-updater and I've also added the job for pre-commit, because I also have it. Each creates a patch that is stored as an artifact.
commit-push gets all of those artifacts, applies them and creates a PR with them.
Finally, cleanup-artifacts removes the artifacts, because it's effectively trash at that point.

Happy to accept improvements.

from github-actions-version-updater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.