ci: fix notify e2e failure (#2078)

This commit is contained in:
Adrian Stobbe 2023-07-10 10:44:30 +02:00 committed by GitHub
parent c6230ff8ca
commit 304fbf04e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,18 +88,11 @@ runs:
if [[ -n "${{ inputs.refStream }}" ]]; then
yq -iP '.attachments[0].content.body[0].columns[1].items[2].facts += [ { "title": "RefStream", "value": "${{ inputs.refStream }}" } ]' teams_payload.json
fi
text_value="<at>{{ steps.pick-assignee.outputs.assignee }}</at>"
text_value="<at>${{ steps.pick-assignee.outputs.assignee }}</at>"
entities=$(jq -c '.attachments[0].content.msteams.entities[]' teams_payload.json)
echo ENTITIES $entities
# need to filter entities to only have entry of mentioned person
filtered_entity=$(echo $entities | jq -r --arg text_value "$text_value" 'select(.text == $text_value)')
echo FILTER $filtered_entity
echo BEFORE_INSERT
jq '.attachments[0].content.msteams.entities' teams_payload.json
yq -iP '.attachments[0].content.msteams.entities = [ '"$(echo $entities | jq -r --arg text_value "$text_value" 'select(.text == $text_value)')"' ]' teams_payload.json
jq '.attachments[0].content.msteams.entities' teams_payload.json
echo AFTER_INSERT
filtered_entity=$(echo $entities | jq --arg text_value "$text_value" 'select(.text == $text_value)')
yq -iP '.attachments[0].content.msteams.entities = [ '"$filtered_entity"' ]' teams_payload.json
yq -iP '.attachments[0].content.body[0].columns[1].items[2].facts += [ { "title": "Assignee", "value": "<at>${{ steps.pick-assignee.outputs.assignee }}</at>" } ]' teams_payload.json
yq -iP '.attachments[0].content.actions[0].url = "${{ steps.create-project-card.outputs.jobURL }}"' teams_payload.json