Skip to content

🪄 GitHub Action for dynamic template on PR body and title

License

Notifications You must be signed in to change notification settings

luigibertaco/dynamic-template-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🪄 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

Required The GITHUB_TOKEN secret for the repository. It is required to give access to the action to perform changes to the Pull Request body using the GitHub API.

Example usage

      - uses: luigibertaco/dynamic-template-action@1.0.0
        with:
          token: "${{ secrets.GITHUB_TOKEN }}"

About

🪄 GitHub Action for dynamic template on PR body and title

Resources

License

Stars

Watchers

Forks

Packages

No packages published