Giter VIP home page Giter VIP logo

dynamic-template-action-1's Introduction

๐Ÿช„ GitHub Action for Dynamic Templates

This action uses mustache to enhance the power of GitHub Templates. It allows the templates to include dynamic values that will be populated with the information related to the PR (Pull Request) on pre defined template tags. The most basic usage is for adding the branch name as part of a link to the ticketing system.

For example, in a scenario where the developer is supposed to use branch names that matches the ticket number from JIRA and the link should be present on the PR body, the repository PR template would have something similar to the following:

Related to https://your-jira-url.com/browse/{{head.ref}}

This PR changes:
  - 
  - 
  - 

Where, head.ref is the path on the PR payload to the current branch that will be merged into the base branch. For instance, if the base branch for the current PR is called BUG-123 and the user adds information to the body while creating the PR, it will save the body as:

Related to https://your-jira-url.com/browse/{{head.ref}}

This PR changes:
  - Adds a 500 line snippet from stackoverflow that I don't know how it works,
    but it works

After action execution, the body will be:

Related to https://your-jira-url.com/browse/BUG-123

This PR changes:
  - Adds a 500 line snippet from stackoverflow that I don't know how it works,
    but it works

Inputs

token

The GITHUB_TOKEN secret to access the repository. Defaults to github-actions internal ${{ github.token }} Token.

customInput

The customInput sets additional data to access in your templates. For example data from previous workflow steps. Access it via {{ custom.YOUR_PROPERTY_NAME }}

Example usage

Basic

      - uses: luigibertaco/[email protected]

Can render:

    Your PR was created: {{ head.ref }}

With customInput

      - name: Get current date
        id: date
        run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')"

      - uses: luigibertaco/[email protected]
        with:
          customInput: 
            today: ${{ steps.date.outputs.date }}
            now: ${{ steps.date.outputs.date }}

Can render:

    Your PR was created: {{ custom.today }}

dynamic-template-action-1's People

Contributors

datadeer avatar luigibertaco avatar samcmalaska 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.