This action adds JIRA issue properties as labels in your Pull Request. You can customize which properties you want to add as labels here:
priority
: Shows the name of the priority defined in the Jira issue.
name: On pull request opened
on:
pull_request:
branches:
- master
jobs:
jira_labels:
runs-on: ubuntu-latest
name: Label Pull Request with Jira properties
steps:
- name: Label with JIRA issue properties
uses: xserrat/pr-jira-properties-labeler@v1.0.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_ENCODED_TOKEN: ${{ secrets.JIRA_ENCODED_TOKEN }}
JIRA_URI: ${{ secrets.JIRA_URI }}
regexp_jira_issue_code_on_pr_title: '^([A-Z]{3}-[0-9]{4}).*'
issue_properties: '[priority]'
Those inputs marked as secret
(🤫) need to be added here: https://github.com/{username}/{repository}/settings/secrets
.
Required It's a needed secret (THIS TOKEN IS FULFILLED AUTOMATICALLY, YOU DON'T HAVE TO ADD IT)
It's the needed token to make requests to the JIRA api.
This token is the combination in base64 of your user email to access to your JIRA and the API token created in the following section:
Your profile > Manage your account > Security > API Token: Create and manage API tokens > Create API token
So, to obtain the JIRA_ENCODED_TOKEN
you have to execute the following:
echo -n "your-email-for-jira-account:your-api-token" | base64
It's the URI of JIRA used to enter through the browser. Example: https://mycompany.atlassian.net
or https://mycompany.jira.com
Required
The regular expression to obtain the issue code of your pull request from the PR title.
Default "^([A-Z]{3}-[0-9]{4}).*"
.
Using the default value, the action will parse those PRs with a title like: "ABC-1234 Feature to do something".
Required A list of properties you want to add as labels in your Pull Request.
Right now, the only property available is priority
but in the future you can select more.
Thanks to Marc Cornellà to introduce me on Github Actions and show me this post https://blog.jessfraz.com/post/the-life-of-a-github-action/ of Jess Frazelle !