Created
January 30, 2023 17:46
-
-
Save engelin/d094d1d70eaa248406d99eb5b1bd2313 to your computer and use it in GitHub Desktop.
Jira & github integration backup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create a Jira Issue | |
on: | |
issues: | |
types: | |
- opened | |
- reopened | |
jobs: | |
create-jira-issue: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to Jira | |
uses: atlassian/gajira-login@master | |
env: | |
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} | |
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} | |
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} | |
- name: Set Issue Bug type | |
if: contains(github.event.issue.labels.*.name, 'bug') == true | |
run: echo "ISSUE_TYPE=Bug" >> $GITHUB_ENV | |
- name: Set Issue Task type | |
if: contains(github.event.issue.labels.*.name, 'bug') == false | |
run: echo "ISSUE_TYPE=Task" >> $GITHUB_ENV | |
- name: Create issue | |
if: contains(github.event.issue.labels.*.name, 'from jira') == false | |
id: create | |
uses: atlassian/gajira-create@master | |
with: | |
project: A3MS | |
issuetype: ${{ env.ISSUE_TYPE }} | |
summary: git_webhook) ${{ github.event.issue.title }} | |
description: ${{ github.event.issue.body }} | |
- name: Log created issue | |
if: contains(github.event.issue.labels.*.name, 'from jira') == false | |
run: echo "Issue ${{ steps.create.outputs.issue }} was created" | |
- name: Comment to JIRA | |
uses: atlassian/gajira-comment@master | |
with: | |
issue: ${{ steps.create.outputs.issue }} | |
comment: Git ticket num-${{ github.event.issue.number }} by git_webhook | |
- name: Update issue | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: 'update-issue' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ github.event.issue.number }} | |
title: ${{ steps.create.outputs.issue }} ${{ github.event.issue.title }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Automation
Send a webhook Jira --> Github