Coder Social home page Coder Social logo

input-merger-action's Introduction

input-merger-action

Combines user and default inputs for your workflows.

Donate

Build Maintainable Coverage Issues Commit License Tag Size Label Label

Motivation

I just want to use the inputs without taking care where they come from (rest, ui, trigger).

Usage

# RUNNER
on:
  repository_dispatch:
  workflow_call:
    inputs:
      input_1:
        type: string
        required: false
        default: 'default_1'
      input_2:
        type: string
        required: false
        default: 'default_2'
  workflow_dispatch:
    inputs:
      input_1:
        type: string
        required: false
        default: 'default_3'
      input_2:
        type: string
        required: false
        default: 'default_4'

jobs:
  tag:
    runs-on: ubuntu-latest
    steps:
      - name: "Read Input Info"
        id: "input_info"
        uses: YunaBraska/input-merger-action@main

      # PRINT
      - name: "Print Input Info"
        run: |
          echo "input_1 [${{ steps.input_info.outputs.input_1 }}]"
          echo "input_2 [${{ steps.input_info.outputs.input_2 }}]"

Inputs

parameter default description
work-dir '.' work dir
ignore-files null regex list to ignore files (comma separated) e.g. '/.txt$/, /.doc$/'
branch-fallback 'main' fallback if no branch_default could be found
tag-fallback null fallback if no tag could be found
fallback-commit-type '' fallback for commits without type (Conventional Commits)
fallback-commit-scope '' fallback for commits without scope (Conventional Commits)
commit-msg-with-footer true include footer from commit messages (Conventional Commits)

Outputs

Name default description
branch main current branch
branch_default main default branch
commits_ahead 0 branch commits that are not in the branch_default
commits_behind 0 branch_default commits that are not in the branch
is_default_branch false true if branch == branch_default
has_changes false true if sha_latest != sha_latest_tag
has_local_changes false true if there are changes on non committed files
has_breaking_changes false true if a commit has a breaking change (Conventional Commits)
sha_latest null sha from latest commit
sha_latest_tag null sha from latest tag
tag_latest 0.0.1 latest tag
ticket_numbers "" list of ticket numbers (Jira GitHub)
commit_types "" list of types (Conventional Commits)
commit_scopes "" list of scopes (Conventional Commits)
commit_type_<type> "" list of commit messages for the given commit type (Conventional Commits)
commit_scope_<scope> "" list of commit messages for the given commit scope (Conventional Commits)
x_has_changes_<lang> false true on file changes exists between current sha and latest tag
x_has_local_changes_<lang> false true if there are changes on non committed files for the specific language
x_language_list - a list of supported languages for x_has_changes_<lang> and x_has_local_changes_<lang>

[DEV] Setup Environment

  • clean environment: ./clean_node.sh
  • Build: npm run build to "compile" index.ts to ./lib/index.js
  • Test: npm run build && npm run test:coverage
  • NodeJs 16: do not upgrade nodeJs as GitHub actions latest version is 16
  • Hint: please do not remove the node modules as they are required for custom GitHub actions :(

input-merger-action's People

Contributors

yunabraska avatar

Watchers

 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.