![]() const core = github = jiraPrefix = core.getInput("jira-prefix") Ĭonst prTitle = _request.title Ĭonst prBody = _request. Let's create index.js file, which will containg the action code. Write the following example code in the file: name: "Jira Issue Key Checker"ĭescription: "Checks If a PR contains its linked Jira issue key in both the title and the description."ĭescription: "Jira issue key prefix. ![]() It also tells the action runner how to start running this JavaScript action. Create an action metadata fileĬreate a file called action.yml. The package grants access to GitHub Actions contexts. github.eventpath is a path to JSON file with same contents as github.event context. Probably you mean will be edited or opened, etc. Npm install npm install package provides an interface to the workflow commands, input and output variables, exit statuses, and debug messages. Azeem github.eventname is the pullrequest (and this is only event name in my case). ![]() We will also install some dependencies that will help us to integrate our code with GitHub. In this file we will set the details of our project. To see the complete code of the project, you can go here:Īs we'll use Node.js to create this GitHub Action, we will run npm init in our directory to generate package.json file. You can see how to configure and trigger the action here: ' Expressions are commonly used with the conditional if keyword in a workflow file to determine whether a step should run. For more information about contexts, see ' Contexts. You can combine literals, context references, and functions using operators. Do you use Jira as the issue tracker in your company? Do you link GitHub PRs with Jira issues, and you want to ensure that link exists in every created PR of your repository? This GitHub Action is for you! Workflowĭefining a Jira "prefix" issue, Jira Issue Key Checker will verify every PR created in your repository contains a linked Jira issue key in both the PR title and description. An expression can be any combination of literal values, references to a context, or functions. ![]()
0 Comments
Leave a Reply. |