From ecec6feac0e4fe02764c3f86e20b0110b6918f00 Mon Sep 17 00:00:00 2001 From: Kenroy Gobourne <14842108+sultanofcardio@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:17:23 -0500 Subject: [PATCH] chore: Include extra data in call to JIRA webhook (#1665) Whenever a release candidate deployment happens from this repository, a GitHub Actions workflow attempts to process the tickets it contains, and consumes a Jira webhook that triggers an automation to move those tickets into the "To Be Tested" column. I recently updated that automation to also leave a comment on the ticket when the deployment happens This PR adds more details to the webhook call so that the comment may include more details about the deployment. These details are: - The release candidate tag - The repository URL --- .github/workflows/update-jira-tickets.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-jira-tickets.yaml b/.github/workflows/update-jira-tickets.yaml index bf30629e1ea..b9c11b48f67 100644 --- a/.github/workflows/update-jira-tickets.yaml +++ b/.github/workflows/update-jira-tickets.yaml @@ -103,6 +103,8 @@ jobs: echo "tickets=${jiraTickets}" >> $GITHUB_OUTPUT - name: Periodically ping Jenkins for current tag build status + env: + REPO_URL: "${{ github.server_url }}/${{ github.repository }}" run: | repoName=${GITHUB_REPOSITORY##*/} currentTag="${{ steps.get-tag.outputs.tag }}" @@ -124,7 +126,7 @@ jobs: if [[ "$result" == "SUCCESS" ]]; then echo "Build successful! Submitting ticket numbers to Jira" tickets="${{ steps.jira-tickets.outputs.tickets }}" - json="{ \"issues\": $(echo "${tickets}" | jq -R -s -c 'split(" ")[:-1]') }" + json="{ \"issues\": $(echo "${tickets}" | jq -R -s -c 'split(" ")[:-1]'), \"data\": { \"tag\": \"${currentTag}\", \"repository\": \"${REPO_URL}\" } }" curl -X POST -H 'Content-Type: application/json' --url "${JIRA_WEBHOOK_URL}" --data "$json" break elif [[ "$result" != "null" ]]; then