Create a Jira issue for every eslint-disable comment in the Pull Request
Note: this action requires Jira Login Action
Create Jira issue from eslint-disable comments in pushed code.
Single-line comments in these formats:
// eslint-disable-next-line no-undefined
/* eslint-disable prefer-promise-reject-errors */
Example workflow which is triggered on pull request merge:
on:
pull_request:
types: [closed]
jobs:
build:
if: github.event.pull_request.merged == 'true'
runs-on: ubuntu-latest
steps:
- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.URL }}
JIRA_USER_EMAIL: ${{ secrets.EMAIL }}
JIRA_API_TOKEN: ${{ secrets.TOKEN }}
- name: Find task key
id: find_key
uses: atlassian/gajira-find-issue-key@master
with:
string: ${{ github.event.pull_request.title }}
from: ""
- name: Create Jira Task
uses: optimaxdev/eslint-disable-jira@master
with:
project: PROJECT_KEY
issuetype: Improvement
baseUrl: ${{ secrets.URL }}
email: ${{ secrets.EMAIL }}
token: ${{ secrets.TOKEN }}
taskId: ${{ steps.find_key.outputs.issue }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN
- GitHub secret token is used to retrieve diffs
project
- Key of the projectissuetype
- Type of the issue to be created. Example: 'Task'baseUrl
- Base URL of you jira boardemail
- Jira account emailtoken
- Jira account tokentaskId
- ID of the task that this PR is linked to
issues
: Well-formed JSON array containing keys of all newly created issues
- Needs a task id to assign the created task to the appropriate person and team
- Handles multiple eslint-disables, whether they are in the same file or not. A separate task is created for each one of them.
- Created task has appropriate platform (D/M) in its summary, and the file route is listed in the description, as well as a link to the original PR