|
20 | 20 | types: [opened, synchronize]
|
21 | 21 |
|
22 | 22 | jobs:
|
23 |
| - check_pr_origin: |
| 23 | + build: |
24 | 24 | runs-on: self-hosted
|
25 |
| - |
26 | 25 | 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: |
30 | 29 | 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" \ |
41 | 36 | "https://api.github.com/orgs/$PR_ORG/teams/$TEAM_SLUG/memberships/$PR_USER")
|
42 | 37 |
|
43 |
| - if [ -z "$TEAM_MEMBERSHIP" ]; then |
44 |
| - - name: Login |
45 |
| - uses: atlassian/gajira-login@v3 |
46 |
| - env: |
| 38 | + env: |
47 | 39 | JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
|
48 | 40 | JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
|
49 | 41 | 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