From 8381579e931405546b7c90a72ac7ceebb567485f Mon Sep 17 00:00:00 2001 From: Kenroy Gobourne Date: Fri, 12 Apr 2024 05:14:12 -0500 Subject: [PATCH] Update Jira Tickets 2 Fetch all commits before determining JIRA tickets The checkout action does a shallow clone by default, so we have to unshallow the clone in order to get all the commit messages. I decided to do it this way, instead of doing a deep clone from the outset because there are several exit points for the job that would render the deep clone unnecessary. So I do it at the point where it's needed --- .github/workflows/update-jira-tickets.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-jira-tickets.yaml b/.github/workflows/update-jira-tickets.yaml index 71a63b47d..c7e57a76c 100644 --- a/.github/workflows/update-jira-tickets.yaml +++ b/.github/workflows/update-jira-tickets.yaml @@ -95,6 +95,7 @@ jobs: run: | currentTag="${{ steps.get-tag.outputs.tag }}" previousTag="${{ steps.ping-jenkins.outputs.tagName }}" + git fetch --unshallow commitMessages=$(git log --pretty=%B $previousTag..$currentTag) echo "Commit messages since the last release: ${commitMessages}" jiraTickets=$(echo "$commitMessages" | grep -io 'M2-[0-9]\+' | tr '[:lower:]' '[:upper:]' | sort | uniq | tr '\n' ' ')