Skip to content

Commit ee7fe29

Browse files
authored
Revert "Q1 Jira Workflow Updates" (#609)
* Revert "Q1 Jira Workflow Updates (#600)" This reverts commit a2fa807. * Add files via upload
1 parent a2fa807 commit ee7fe29

File tree

2 files changed

+45
-51
lines changed

2 files changed

+45
-51
lines changed

.github/workflows/jira-issue-transfer.yml

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,25 @@ jobs:
2929
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
3030
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
3131
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
32-
if: github.event.label.name == 'ticketed' && !contains(github.event.issue.labels.*.name, 'ticketed')
33-
if: contains(github.event.issue.labels.*.name, 'bug')
34-
- name: Jira Create
35-
uses: atlassian/gajira-create@v3
36-
with:
37-
project: BP
38-
issuetype: 'Bug Report'
39-
summary: ${{ github.event.issue.title }}
40-
description: "Github Issue Link: ${{ github.event.issue.html_url}} \r\n ${{ github.event.issue.body }}"
41-
fields: '{"labels":["GitHubReport"]}'
42-
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
if: contains(github.event.issue.labels.*.name, 'enhancement')
45-
- name: Jira Create
46-
uses: atlassian/gajira-create@v3
47-
with:
48-
project: BP
49-
issuetype: 'Product Feature'
50-
summary: ${{ github.event.issue.title }}
51-
description: "Github Issue Link: ${{ github.event.issue.html_url}} \r\n ${{ github.event.issue.body }}"
52-
fields: '{"labels":["GitHubReport"]}'
53-
env:
5432
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
if: github.event.label.name == 'ticketed' && !contains(github.event.issue.labels.*.name, 'ticketed')
34+
if: contains(github.event.issue.labels.*.name, 'bug')
35+
- name: Jira Create
36+
uses: atlassian/gajira-create@v3
37+
with:
38+
project: BP
39+
issuetype: 'Bug Report'
40+
summary: ${{ github.event.issue.title }}
41+
description: "Github Issue Link: ${{ github.event.issue.html_url}} \r\n ${{ github.event.issue.body }}"
42+
fields: '{"labels":["GitHubReport"]}'
43+
44+
if: contains(github.event.issue.labels.*.name, 'enhancement')
45+
- name: Jira Create
46+
uses: atlassian/gajira-create@v3
47+
with:
48+
project: BP
49+
issuetype: 'Product Feature'
50+
summary: ${{ github.event.issue.title }}
51+
description: "Github Issue Link: ${{ github.event.issue.html_url}} \r\n ${{ github.event.issue.body }}"
52+
fields: '{"labels":["GitHubReport"]}'
5553

.github/workflows/pr-jira-issue-transfer.yml

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,40 +20,36 @@ on:
2020
types: [opened, synchronize]
2121

2222
jobs:
23-
check_pr_origin:
23+
build:
2424
runs-on: self-hosted
25-
2625
steps:
27-
- name: Check if PR is from within the organization
28-
id: check_org
29-
run:
26+
- name: Check if PR is from within the organization
27+
id: check_org
28+
run:
3029
PR_URL=$(jq -r .pull_request.url "$GITHUB_EVENT_PATH")
31-
PR_NUMBER=$(jq -r .pull_request.number "$GITHUB_EVENT_PATH")
32-
TEAM_SLUG="bloodhound-engineering" # Replace with your team's slug
33-
GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}"
34-
35-
# Get PR information
36-
PR_ORG=$(jq -r .pull_request.head.repo.organization.login "$GITHUB_EVENT_PATH")
37-
PR_USER=$(jq -r .pull_request.user.login "$GITHUB_EVENT_PATH")
38-
39-
# Check if PR author is a member of the team
40-
TEAM_MEMBERSHIP=$(curl -s -X GET -H "Authorization: token $GITHUB_TOKEN" \
30+
PR_NUMBER=$(jq -r .pull_request.number "$GITHUB_EVENT_PATH")
31+
TEAM_SLUG="bloodhound-engineering" # Replace with your team's slug
32+
GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}"
33+
PR_ORG=$(jq -r .pull_request.head.repo.organization.login "$GITHUB_EVENT_PATH")
34+
PR_USER=$(jq -r .pull_request.user.login "$GITHUB_EVENT_PATH")
35+
TEAM_MEMBERSHIP=$(curl -s -X GET -H "Authorization: token $GITHUB_TOKEN" \
4136
"https://api.github.com/orgs/$PR_ORG/teams/$TEAM_SLUG/memberships/$PR_USER")
4237

43-
if [ -z "$TEAM_MEMBERSHIP" ]; then
44-
- name: Login
45-
uses: atlassian/gajira-login@v3
46-
env:
38+
env:
4739
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
4840
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
4941
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
50-
- name: Jira Create
51-
uses: atlassian/gajira-create@v3
52-
with:
53-
project: BP
54-
issuetype: 'Product Feature'
55-
summary: ${{ github.event.pulls.title }}
56-
description: "Github Pull Request Link: ${{ github.event.pulls.html_url}} \r\n ${{ github.event.pulls.body }}"
57-
fields: '{"labels":["GitHubReport"]}'
58-
env:
59-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
44+
if [ -z "$TEAM_MEMBERSHIP" ]; then
45+
- name: Login
46+
uses: atlassian/gajira-login@v3
47+
- name: Jira Create
48+
uses: atlassian/gajira-create@v3
49+
with:
50+
project: BP
51+
issuetype: 'Product Feature'
52+
summary: ${{ github.event.pulls.title }}
53+
description: "Github Pull Request Link: ${{ github.event.pulls.html_url}} \r\n ${{ github.event.pulls.body }}"
54+
fields: '{"labels":["GitHubReport"]}'
55+

0 commit comments

Comments
 (0)