Skip to content

Commit

Permalink
chore: Include extra data in call to JIRA webhook (#1665)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sultanofcardio authored Dec 10, 2024
1 parent 122328e commit ecec6fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/update-jira-tickets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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
Expand Down

0 comments on commit ecec6fe

Please sign in to comment.