Giter Site home page Giter Site logo

sherlouk / swift-package-dependencies-check Goto Github PK

View Code? Open in Web Editor NEW

This project forked from marcoeidinger/swift-package-dependencies-check

0.0 0.0 0.0 17 KB

Catch up with outdated versions based on your package dependency requirements

Dockerfile 33.04% Shell 66.96%

swift-package-dependencies-check's Introduction

Swift Package Dependencies Checker

This action process your Package.swift file to detect outdated versions based on your package dependency requirements.

This action requires actions/checkout in order to function correctly.

  spm-dep-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: MarcoEidinger/swift-package-dependencies-check@v2

Action will fail in case there are outdated dependencies. This can be suppressed by setting input parameter failWhenOutdated to false. Then use output parameter outdatedDependencies to know if action detected any outdated dependencies.

  spm-dep-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: MarcoEidinger/[email protected]
        with:
          failWhenOutdated: false # or 'false'

By setting isMutating you declare the intention to update Package.resolved (if present). Please note that the action itself does not commit/push changes.

  spm-dep-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: MarcoEidinger/swift-package-dependencies-check@v2
        with:
          isMutating: 'true' # or true

When setting isMutating the tool SwiftPackageIndex/ReleaseNotes is used to return release notes URLs for detected, necessary updates.

A possible workflow to periodically check for outdated dependencies and then create a pull request to update them:

name: Swift Package Dependencies

on: 
  schedule:
    - cron: '0 8 * * 1' # every monday AM 8:00
jobs:
  spm-dep-check:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - name: Check Swift package dependencies
      id: spm-dep-check
      uses: MarcoEidinger/[email protected]
      with:
         isMutating: true
         failWhenOutdated: false
    - name: Create Pull Request
      if: steps.spm-dep-check.outputs.outdatedDependencies  == 'true'
      uses: peter-evans/create-pull-request@v3
      with:
        commit-message: 'chore: update package dependencies'
        branch: updatePackageDepedencies
        delete-branch: true
        title: 'chore: update package dependencies'
        body: ${{ steps.spm-dep-check.outputs.releaseNotes }}

For your convenience I created a workflow which can reuse like this.

name: Swift Package Dependencies

on: 
  schedule:
    - cron: '0 8 * * 1' # every monday AM 8:00 
jobs:
  dependencies:
    uses: MarcoEidinger/swift-package-dependencies-check/.github/workflows/reusableWorkflow.yml@v2
    with:
      commit-message: 'chore: update package dependencies'

Internally the action utilizes swift package show-dependencies and swift package update (either with or without the --dry-run option). Per default it runs as non-modifying, i.e. with --dry-run.

You can also pin to a specific release version in the format @2.x.x

  • Version 1.0.x is using Swift 5.2
  • Version 1.1.x is using Swift 5.3
  • Version 2.0.x is using Swift 5.5
  • Version 2.1.x is using Swift 5.5

swift-package-dependencies-check's People

Contributors

marcoeidinger avatar sherlouk avatar

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.