GitHub Action to check JIRA story for labels matching a required/approved convention.
Primary use case for this is to prevent someone from merging a PR without external approval. JIRA tags in a commit message or PR title is used to get labels on the issue and find matching pairs of labels.
The convention operates based on the -required
and -approved
suffixes and works with any content before that.
#Inputs
Please check the action.yml
for a full list of required and optional inputs.
#Sample Action
name: Jira Approval
on:
push:
branches-ignore:
- main
jobs:
job:
name: Ticket Labels
runs-on: ubuntu-latest
steps:
- name: Check Jira Ticket Labels
uses: g2crowd/[email protected]
with:
commit_message: ${{ github.event.commits[0]['message'] }}
pr_title: ${{ github.event.pull_request.title }}
jira_user: ${{secrets.JIRANAME}}
jira_token: ${{secrets.JIRATOKEN}}
jira_url: organization.atlassian.net
yarn install
yarn test
-
Install
vercel/ncc
by running this command in your terminal.npm i -g @vercel/ncc
-
Compile your index.js file.
ncc build index.js --license licenses.txt