Skip to content

Commit a180703

Browse files
committed
address sonarqube findings for harvest sync [skip ci]
1 parent 53eac97 commit a180703

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/harvestr-update-discovery.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Harvestr Updates (Feedback)
22

33
on:
44
issues:
5+
# listen for key events that indicate a change in the issue's lifecycle
56
types: [assigned, closed, milestoned, demilestoned]
67

78

@@ -11,12 +12,14 @@ jobs:
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Find comment matching a regex pattern
14-
uses: peter-evans/find-comment@v3
15+
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e
1516
id: find_comment
1617
with:
1718
issue-number: ${{ github.event.issue.number }}
1819
body-includes: "Issue was linked to Harvestr Discovery"
20+
# if updated issue is linked Harvestr Discovery, update the discovery state based on the issue lifecycle event
1921
- name: Update Harvestr Discovery
22+
if: steps.find_comment.outputs.comment-found == 'true'
2023
shell: bash
2124
env:
2225
HARVESTR_API_KEY: ${{ secrets.HARVESTR_API_KEY }}
@@ -30,7 +33,7 @@ jobs:
3033
function updateState() {
3134
local state="$1"
3235
echo "Updating Harvestr item ${HARVEST_ID} to state: ${state} via https://rest.harvestr.io/v1/discovery/${HARVEST_ID}"
33-
curl -LX PATCH "https://rest.harvestr.io/v1/discovery/${HARVEST_ID}" \
36+
curl --proto "=https"-LX PATCH "https://rest.harvestr.io/v1/discovery/${HARVEST_ID}" \
3437
-H "X-Harvestr-Private-App-Token: ${HARVESTR_API_KEY}" \
3538
-H "Content-Type: application/json" \
3639
-H 'Accept: application/json' \

0 commit comments

Comments
 (0)