Skip to content

Commit

Permalink
In case of infrastructure failure show pipeline.log (#47)
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <[email protected]>
  • Loading branch information
phracek authored May 30, 2022
1 parent 08d671d commit 507d297
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ runs:
result=$(jq -r .result.overall job.json)
new_state="success"
infra_error=" "
log=""
echo "State is $state and result is: $result"
if [ "$state" == "complete" ]; then
if [ "$result" != "passed" ]; then
Expand All @@ -261,11 +262,13 @@ runs:
# Mark job in case of infrastructure issues. Report to Testing Farm team
infra_error=" - Infra problems"
new_state="failure"
log="pipeline.log"
fi
echo "New State is: $new_state"
echo "Infra state is: $infra_error"
echo "::set-output name=FINAL_STATE::$new_state"
echo "::set-output name=INFRA_STATE::$infra_error"
echo "::set-output name=LOG::$log"
shell: bash

- name: Switch pull request GitHub status to final state
Expand All @@ -277,7 +280,7 @@ runs:
"state": "${{ steps.final_state.outputs.FINAL_STATE }}",
"context": "Testing Farm - ${{ inputs.pull_request_status_name }}",
"description": "Build finished${{ steps.final_state.outputs.INFRA_STATE }}",
"target_url": "${{ steps.artifacts_url.outputs.url }}/${{ steps.sched_test.outputs.req_id }}"
"target_url": "${{ steps.artifacts_url.outputs.url }}/${{ steps.sched_test.outputs.req_id }}/${{ steps.final_state.outputs.LOG }}"
}
EOF
if [ "${{ inputs.debug }}" == "true" ]; then
Expand Down

0 comments on commit 507d297

Please sign in to comment.