From 6fc2d2c88349e9b7fa26ba66643904d228d85bb0 Mon Sep 17 00:00:00 2001 From: Reva Denis Date: Tue, 11 Jul 2023 11:26:42 +0500 Subject: [PATCH 1/2] Update action.yml : improved posix compatibility MacOS requires setting '-' in |paste -sd , | explicitly to support unix pipe. --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index fef8978..b7bc838 100644 --- a/action.yml +++ b/action.yml @@ -22,7 +22,7 @@ runs: export LC_ALL=en_US.utf8 git log $(git describe --abbrev=0 2> /dev/null || git rev-list --max-parents=0 HEAD)..HEAD | \ grep -oE "${{ inputs.jira-project-key }}-[[:digit:]]{1,}" | sort | uniq | \ - sed 's/^\|$/"/g' | paste -sd , | awk '{print "RELATED_JIRA_ISSUES="$0}' >> $GITHUB_ENV + sed 's/^\|$/"/g' | paste -sd , - | awk '{print "RELATED_JIRA_ISSUES="$0}' >> $GITHUB_ENV shell: bash - name: Create json and invoke webhook From 64c2fe1897e88e7fd5e0fe552ec6cef72dcb59db Mon Sep 17 00:00:00 2001 From: Reva Denis Date: Tue, 11 Jul 2023 12:19:42 +0500 Subject: [PATCH 2/2] Update action.yml: fixed powershell types --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index b7bc838..aa62451 100644 --- a/action.yml +++ b/action.yml @@ -27,7 +27,7 @@ runs: - name: Create json and invoke webhook run: | - $json = ConvertTo-Json @{issues = @(${{ env.RELATED_JIRA_ISSUES }}); data = @{version = "${{ inputs.build-version }}"; projectName = "${{ inputs.jira-project-key }}"}} + $json = ConvertTo-Json @{issues = @("${{ env.RELATED_JIRA_ISSUES }}"); data = @{version = "${{ inputs.build-version }}"; projectName = "${{ inputs.jira-project-key }}"}} [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Invoke-RestMethod ${{ inputs.jira-automation-webhook }} -Method Post -Body $json -ContentType "application/json" shell: pwsh