Skip to content

Commit 40e26d7

Browse files
CLOUDP-300586: Add team vars to failure handler (#426)
1 parent 6fef1de commit 40e26d7

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

.github/scripts/create_jira_ticket.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# 2. URL encodes the JIRA ticket title.
77
# 3. Checks if a JIRA ticket with the same title already exists in the specified project (id=10984) and component (id=35986).
88
# 4. If a ticket already exists, it exits without creating a new ticket.
9-
# 5. If no ticket exists, it creates a new JIRA ticket with the provided title and description.
9+
# 5. If no ticket exists, it creates a new JIRA ticket with the provided title, description and team id.
1010
# 6. Outputs the ID of the created JIRA ticket and sets it as a GitHub Actions output variable.
1111

1212
set -eou pipefail
@@ -64,7 +64,7 @@ json_response=$(curl --request POST \
6464
},
6565
"customfield_12751": [
6666
{
67-
"id": "22223"
67+
"id": "${JIRA_TEAM_ID:?}"
6868
}
6969
],
7070
"description": "${JIRA_TICKET_DESCRIPTION:?}",

.github/workflows/failure-handler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
description: 'Name of the release.'
1111
required: true
1212
type: string
13+
team_id:
14+
description: 'ID of Jira Team'
15+
required: true
16+
type: string
1317
secrets: # all secrets are passed explicitly in this workflow
1418
jira_api_token:
1519
required: true
@@ -72,6 +76,7 @@ jobs:
7276
JIRA_API_TOKEN: ${{ secrets.jira_api_token }}
7377
JIRA_TICKET_TITLE: "(${{inputs.env}}) The ${{inputs.release_name}} release has failed. GH Issue: ${{steps.create-issue.outputs.number}}"
7478
JIRA_TICKET_DESCRIPTION: "The release process ${{inputs.release_name}} in [mongodb/openapi|https://github.com/mongodb/openapi] has failed. Please, look at the [issue-${{steps.create-issue.outputs.number}}|https://github.com/mongodb/openapi/issues/${{steps.create-issue.outputs.number}}] for more details."
79+
JIRA_TEAM_ID: ${{ inputs.team_id }}
7580
run: .github/scripts/create_jira_ticket.sh
7681
- name: Add comment to GH Issue
7782
if: ${{ steps.create-issue.outputs.number != null }}

.github/workflows/release-IPA-metrics.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ jobs:
5656
with:
5757
env: 'dev'
5858
release_name: "IPA Metrics"
59+
team_id: ${{ vars.JIRA_TEAM_ID_APIX_1 }}
5960
secrets:
6061
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}

.github/workflows/release-cli.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,6 @@ jobs:
8080
with:
8181
env: "prod"
8282
release_name: "FOASCLI"
83+
team_id: ${{ vars.JIRA_TEAM_ID_APIX_2 }}
8384
secrets:
8485
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}

.github/workflows/release-spec.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,6 @@ jobs:
192192
with:
193193
env: ${{ inputs.env }}
194194
release_name: "OpenAPI Spec"
195+
team_id: ${{ vars.JIRA_TEAM_ID_APIX_2 }}
195196
secrets:
196197
jira_api_token: ${{ secrets.JIRA_API_TOKEN }}

0 commit comments

Comments
 (0)