Code Monkey home page Code Monkey logo

actions-project-version-check's Introduction

Changelog

This repo is a vendored fork of: https://github.com/avides/actions-project-version-check.

v2.0.0

API changes, so major bump

  1. target branch now defaults to main, and must be set.
  2. Failure on bump / not is now an explicit flag (fail-build-if-not-bumped). The updated project version and semver result is now always output as a variable.
  3. Additional files now fails only if the branch version isn't there AND the target version is.

v1.2.2

Compatible with forked version.

  1. Removal of XML parser to reduce dependencies
  2. upgrade dependencies and lint rules.

actions-project-version-check

This action checks if the project version has been updated in your pull request. The action will request the file content (file with name from environment variable file-to-check) from the pull request target branch and parse the project version. After that the local project version will be checked against the targets one with semver-diff. If the new version is not higher than the old one from target, the action fails.

Currently supported are package.json and version.txt.

Inputs

token

Required The repository token is used to request the target branch file-to-check-file from the GitHub API

file-to-check

Required Filename (with path) that must contain the project version update (examples: pom.xml, package.json or version.txt)

target-branch

Required The target branch. Must be set.

additional-files-to-check

Comma separated list of filenames (with path) that must contain the same version as "file-to-check" (examples: README.md, src/file-with-version.txt)

fail-build-if-not-bumped

Is used to fail the build if version isn't bumped. defaults to true.

Outputs

version

If the version update is valid then the new version is available as output.

semver

Returns the output of semver-diff, or "no-output"

Example usage

- uses: thomastay/actions-project-version-check@latest
  id: actions_project_version_check
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    file-to-check: pom.xml
    target-branch: main

- name: use-version-from-check
  run: echo "New version is: " ${{ steps.actions_project_version_check.outputs.version }}
- name: use-semver-from-check
  run: echo "Semver diff returned: " ${{ steps.actions_project_version_check.outputs.semver }}

actions-project-version-check's People

Contributors

thomastay avatar

Watchers

 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.