fix getting number of tech.issue for notifications to static number 1 (filter on tag doesn't work)

This commit is contained in:
Nadezhda Fedorova 2024-04-23 13:35:41 +03:00
parent 28b280556b
commit 86fba1814f
2 changed files with 18 additions and 26 deletions

View File

@ -66,12 +66,10 @@ jobs:
- name: Send notification if build crashed
if: ${{ steps.build-script.outcome != 'success' }}
run: |
issueid=$(curl -X 'GET' "$URL/api/v1/repos/$REPO/image-forge/issues?state=open&labels=building&type=issues&page=1&limit=1&token=$T" -H 'accept: application/json' -s | jq '.[].number' -r)
if [[ $issueid != '' ]]; then \
body="Building images finish with some errors."; \
curl -X 'POST' "$URL/api/v1/repos/$REPO/image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s;\
echo "notification about test error is sent to issue $issueid"; \
else echo "no issue to send notification"; fi
issueid=1
body="Building images finish with some errors."
curl -X 'POST' "$URL/api/v1/repos/$REPO/image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s
echo "notification about test error is sent to issue $issueid"
env:
T: ${{ secrets.TOKEN }}
BR: ${{ env.BRANCH }}
@ -117,13 +115,11 @@ jobs:
- name: Send notification if test crashed
if: ${{ env.ERR == 'true' || steps.test-script.outcome == 'failure' }}
run: |
issueid=$(curl -X 'GET' "$URL/api/v1/repos/$REPO/image-forge/issues?state=open&labels=building&type=issues&page=1&limit=1&token=$T" -H 'accept: application/json' -s | jq '.[].number' -r)
if [[ $issueid != '' ]]; then \
errors=$(cat errors.log); \
body="Testing images finish with some errors. $errors"; \
curl -X 'POST' "$URL/api/v1/repos/$REPO/image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s; \
echo "notification about test error is sent to issue $issueid"; \
else echo "no issue to send notification"; fi
issueid=1
errors=$(cat errors.log)
body="Testing images finish with some errors. $errors"
curl -X 'POST' "$URL/api/v1/repos/$REPO/image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s
echo "notification about test error is sent to issue $issueid"
env:
T: ${{ secrets.TOKEN }}
BR: ${{ needs.build-process.outputs.branch }}

View File

@ -66,12 +66,10 @@ jobs:
- name: Send notification if build crashed
if: ${{ steps.build-script.outcome != 'success' }}
run: |
issueid=$(curl -X 'GET' "$URL/api/v1/repos/$REPO/image-forge/issues?state=open&labels=building&type=issues&page=1&limit=1&token=$T" -H 'accept: application/json' -s | jq '.[].number' -r)
if [[ $issueid != '' ]]; then \
body="Building images finish with some errors."; \
curl -X 'POST' "$URL/api/v1/repos/$REPO/image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s;\
echo "notification about test error is sent to issue $issueid"; \
else echo "no issue to send notification"; fi
issueid=1
body="Building images finish with some errors."
curl -X 'POST' "$URL/api/v1/repos/$REPO/image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s
echo "notification about test error is sent to issue $issueid"
env:
T: ${{ secrets.TOKEN }}
BR: ${{ env.BRANCH }}
@ -117,13 +115,11 @@ jobs:
- name: Send notification if test crashed
if: ${{ env.ERR == 'true' || steps.test-script.outcome == 'failure' }}
run: |
issueid=$(curl -X 'GET' "$URL/api/v1/repos/$REPO/image-forge/issues?state=open&labels=building&type=issues&page=1&limit=1&token=$T" -H 'accept: application/json' -s | jq '.[].number' -r)
if [[ $issueid != '' ]]; then \
errors=$(cat errors.log); \
body="Testing images finish with some errors. $errors"; \
curl -X 'POST' "$URL/api/v1/repos/$REPO/image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s; \
echo "notification about test error is sent to issue $issueid"; \
else echo "no issue to send notification"; fi
issueid=1
errors=$(cat errors.log)
body="Testing images finish with some errors. $errors"
curl -X 'POST' "$URL/api/v1/repos/$REPO/image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s
echo "notification about test error is sent to issue $issueid"
env:
T: ${{ secrets.TOKEN }}
BR: ${{ needs.build-process.outputs.branch }}