Code Monkey home page Code Monkey logo

parse-semver-ref-action's Introduction

parse-semver-ref-action

This action parses a a GitHub ref (e.g. refs/tags/v1.2.3) and outputs it's components.

Usage

on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Parse ref
        uses: ryangoree/parse-semver-ref-action@v1
        id: parse
        with:
          ref: ${{ github.ref }}

      - name: Do something with the parsed ref
        run: |
          echo "Major: ${{ steps.parse.outputs.major }}"
          echo "Minor: ${{ steps.parse.outputs.minor }}"
          echo "Patch: ${{ steps.parse.outputs.patch }}"
          echo "Prerelease: ${{ steps.parse.outputs.prerelease }}"
          echo "Build: ${{ steps.parse.outputs.build }}"
          echo "Name: ${{ steps.parse.outputs.name }}"
          echo "Scope: ${{ steps.parse.outputs.scope }}"

Inputs

ref (Required)

The github ref to parse (e.g. refs/tags/v1.0.0, refs/tags/[email protected]).

Outputs

ref

The ref that was parsed.

matched

"true" if the ref matched the semver pattern, "false" otherwise.

major

The major version number from the tag (e.g. 1 from refs/tags/v1.2.3).

minor

The minor version number from the tag (e.g. 2 from refs/tags/v1.2.3).

patch

The patch version number from the tag (e.g. 3 from refs/tags/v1.2.3).

prerelease

The prerelease version from the tag (e.g. alpha from refs/tags/v1.2.3-alpha).

build

The build version from the tag (e.g. build from refs/tags/v1.2.3+build).

name

The package name from the tag (e.g. pkg from refs/tags/[email protected]).

scope

The package scope (if any) from the tag (e.g. org from refs/tags/@org/[email protected]).

parse-semver-ref-action's People

Contributors

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