GithubHelp home page GithubHelp logo

mtconnect / compare-version-action Goto Github PK

View Code? Open in Web Editor NEW
0.0 7.0 1.0 196 KB

A GitHub Action that can be used to compare the release version of the mtconnect_sysml_model against an input version.

License: MIT License

JavaScript 100.00%

compare-version-action's Introduction

compare-version-action

A GitHub Action that can be used to compare the release version of the mtconnect_sysml_model against an input version.

Pre-requisites

This Action requires that the environment variable GITHUB_TOKEN be set correctly.

Inputs

  • version: The semantic version that the MTConnect SysML version should be compared against.

Outputs

  • update_available: A boolean flag indicating whether or not there is a newer semantic version of the MTConnect SysML model compared to the provided version. Returns true if the SysML model version is newer.

Example workflow

Check every day if the MTConnect SysML model has been updated.

on:
  schedule:
    - cron: '0 0 * * *' # run every day at midnight UTC

jobs:
  check-latest-release:
    name: Check latest release of MTConnect SysML model
    runs-on: ubuntu-latest
    steps:
      - name: Compare MTConnect Version
        id: mtc_version
        uses: mtconnect/compare-version-action@main
        with:
          version: "v1.1" # In most cases, replace this with a reference to the latest tag from your own repo
      - name: Check Update Available
        if: ${{ steps.mtc_version.outputs.update_available == false }} # If there is no update, then force this workflow to exit
        uses: actions/github-script@v3
        with:
          script: |
            core.setFailed('No new updates to MTConnect SysML model')
  build:
    needs: check-latest-release # Expects the condition in 'Check Update Available' to have failed, therefore having skipped the set to failure.
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Do something
        run: echo "There appears to be an update, we should do something about that"

compare-version-action's People

Contributors

tbm0115 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  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.