Skip to content

Commit 7bd8b64

Browse files
authored
Merge pull request #103 from MiraGeoscience/DEVOPS-819
2 parents 9d0771c + f1d2227 commit 7bd8b64

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/reusable-jira-pr_add_jira_summary.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ on:
99
JIRA_BASE_URL:
1010
required: true
1111
description: 'The base URL of your JIRA instance'
12-
JIRA_BASIC_AUTH:
12+
JIRA_USER_EMAIL:
1313
required: true
14-
description: 'The base64-encoded username:password for your JIRA instance'
14+
description: 'The email address for your JIRA account'
15+
JIRA_API_TOKEN:
16+
required: true
17+
description: 'The API token for your JIRA account'
18+
1519

1620
jobs:
1721
add_jira_summary:
@@ -20,7 +24,9 @@ jobs:
2024
env:
2125
JIRA_PATTERN: "([A-Z]+)[-# ]*([0-9]+)"
2226
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
23-
JIRA_BASIC_AUTH: ${{ secrets.JIRA_BASIC_AUTH }}
27+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
28+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
29+
2430
steps:
2531

2632
- name: Find JIRA issue key from branch
@@ -39,7 +45,7 @@ jobs:
3945
id: jira_summary_from_branch
4046
run: >
4147
curl -sS -X GET
42-
-H "Authorization: Basic $JIRA_BASIC_AUTH"
48+
-u "${JIRA_USER_EMAIL}:${JIRA_API_TOKEN}"
4349
-H "Content-Type: application/json"
4450
"$JIRA_BASE_URL/rest/api/2/issue/${{ steps.jira_key_from_branch.outputs.issue_key }}"
4551
| echo "summary=$(jq -r '.fields.summary // empty' | xargs)" >> $GITHUB_OUTPUT
@@ -61,7 +67,7 @@ jobs:
6167
id: jira_summary_from_title
6268
run: >
6369
curl -sS -X GET
64-
-H "Authorization: Basic $JIRA_BASIC_AUTH"
70+
-u "${JIRA_USER_EMAIL}:${JIRA_API_TOKEN}"
6571
-H "Content-Type: application/json"
6672
"$JIRA_BASE_URL/rest/api/2/issue/${{ steps.jira_key_from_title.outputs.issue_key }}"
6773
| echo "summary=$(jq -r '.fields.summary // empty' | xargs)" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)