Skip to content

Commit

Permalink
Corrected YAML updates - Indentation and ops order
Browse files Browse the repository at this point in the history
  • Loading branch information
slokie-so authored May 17, 2024
1 parent d9e67f9 commit a1901d0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 42 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/jira-issue-transfer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,25 @@ jobs:
- name: Login
uses: atlassian/gajira-login@v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.event.label.name == 'ticketed' && !contains(github.event.issue.labels.*.name, 'ticketed')
if: contains(github.event.issue.labels.*.name, 'bug')
- name: Jira Create
uses: atlassian/gajira-create@v3
with:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Jira Create Bug
if: github.event.label.name == 'ticketed' && !contains(github.event.issue.labels.*.name, 'ticketed') && contains(github.event.issue.labels.*.name, 'bug')
uses: atlassian/gajira-create@v3
with:
project: BP
issuetype: 'Bug Report'
summary: ${{ github.event.issue.title }}
description: "Github Issue Link: ${{ github.event.issue.html_url}} \r\n ${{ github.event.issue.body }}"
fields: '{"labels":["GitHubReport"]}'

if: contains(github.event.issue.labels.*.name, 'enhancement')
- name: Jira Create
uses: atlassian/gajira-create@v3
with:
- name: Jira Create Enhancement
if: github.event.label.name == 'ticketed' && !contains(github.event.issue.labels.*.name, 'ticketed') && contains(github.event.issue.labels.*.name, 'enhancement')
uses: atlassian/gajira-create@v3
with:
project: BP
issuetype: 'Product Feature'
summary: ${{ github.event.issue.title }}
description: "Github Issue Link: ${{ github.event.issue.html_url}} \r\n ${{ github.event.issue.body }}"
fields: '{"labels":["GitHubReport"]}'

fields: '{"labels":["GitHubReport"]}'
46 changes: 20 additions & 26 deletions .github/workflows/pr-jira-issue-transfer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,27 @@ jobs:
build:
runs-on: self-hosted
steps:
- name: Check if PR is from within the organization
id: check_org
run:
PR_URL=$(jq -r .pull_request.url "$GITHUB_EVENT_PATH")
PR_NUMBER=$(jq -r .pull_request.number "$GITHUB_EVENT_PATH")
TEAM_SLUG="bloodhound-engineering" # Replace with your team's slug
GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}"
PR_ORG=$(jq -r .pull_request.head.repo.organization.login "$GITHUB_EVENT_PATH")
PR_USER=$(jq -r .pull_request.user.login "$GITHUB_EVENT_PATH")
TEAM_MEMBERSHIP=$(curl -s -X GET -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/orgs/$PR_ORG/teams/$TEAM_SLUG/memberships/$PR_USER")

env:
- name: Login
uses: atlassian/gajira-login@v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

if [ -z "$TEAM_MEMBERSHIP" ]; then
- name: Login
uses: atlassian/gajira-login@v3
- name: Jira Create
uses: atlassian/gajira-create@v3
with:
project: BP
issuetype: 'Product Feature'
summary: ${{ github.event.pulls.title }}
description: "Github Pull Request Link: ${{ github.event.pulls.html_url}} \r\n ${{ github.event.pulls.body }}"
fields: '{"labels":["GitHubReport"]}'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Jira Create PR Review
run:
PR_URL=$(jq -r .pull_request.url "$GITHUB_EVENT_PATH")
PR_NUMBER=$(jq -r .pull_request.number "$GITHUB_EVENT_PATH")
TEAM_SLUG="bloodhound-engineering"
GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}"
PR_ORG=$(jq -r .pull_request.head.repo.organization.login "$GITHUB_EVENT_PATH")
PR_USER=$(jq -r .pull_request.user.login "$GITHUB_EVENT_PATH")
if [ -z "$TEAM_MEMBERSHIP" ]; then
uses: atlassian/gajira-create@v3
with:
project: BP
issuetype: 'Product Feature'
summary: ${{ github.event.pulls.title }}
description: "Github Pull Request Link: ${{ github.event.pulls.html_url}} \r\n ${{ github.event.pulls.body }}"
fields: '{"labels":["GitHubReport"]}'

0 comments on commit a1901d0

Please sign in to comment.