Skip to content

Commit 0de5054

Browse files
authored
Collect difference between two tags (instead of latest tag to HEAD)
1 parent a5de726 commit 0de5054

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

action.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ inputs:
77
jira-automation-webhook:
88
description: "Jira automation webhook url"
99
required: true
10-
build-version:
11-
description: "Version identifier"
10+
previous-version:
11+
description: "Previous release version"
12+
required: true
13+
release-version:
14+
description: "Release version"
1215
required: true
1316
runs:
1417
using: "composite"
@@ -20,14 +23,14 @@ runs:
2023
- name: Collect issue numbers since last release/tag
2124
run: |
2225
export LC_ALL=en_US.utf8
23-
git log $(git describe --abbrev=0 2> /dev/null || git rev-list --max-parents=0 HEAD)..HEAD | \
26+
git log ${{inputs.previous-version}}...${{inputs.release-version}} | \
2427
grep -oP "${{ inputs.jira-project-key }}-\d{1,}" | sort | uniq | \
2528
sed 's/^\|$/"/g' | paste -sd , | awk '{print "RELATED_JIRA_ISSUES="$0}' >> $GITHUB_ENV
2629
shell: bash
2730

2831
- name: Create json and invoke webhook
2932
run: |
30-
$json = ConvertTo-Json @{issues = @(${{ env.RELATED_JIRA_ISSUES }}); data = @{version = "${{ inputs.build-version }}"; projectName = "${{ inputs.jira-project-key }}"}}
33+
$json = ConvertTo-Json @{issues = @(${{ env.RELATED_JIRA_ISSUES }}); data = @{version = "${{ inputs.release-version }}"; projectName = "${{ inputs.jira-project-key }}"}}
3134
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
3235
Invoke-RestMethod ${{ inputs.jira-automation-webhook }} -Method Post -Body $json -ContentType "application/json"
3336
shell: pwsh

0 commit comments

Comments
 (0)