Skip to content

Commit 3a8197f

Browse files
committed
CI: Propagate abrupt stops to tutorial GHA run
1 parent 1025526 commit 3a8197f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/tutorials.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,13 @@ jobs:
6565
sleep 300
6666
esac
6767
done
68+
- name: Cancel ongoing run if cancelled or failed
69+
if: ${{ failure() || cancelled() }}
70+
run: |
71+
set -x
72+
RUN_ID=${{ steps.dispatched.outputs.run_id }}
73+
echo "Something went wrong, cancelling dispatched run"
74+
curl -s -X POST \
75+
-H "Accept: application/vnd.github+json" \
76+
-H "Authorization: Bearer ${{ secrets.TUTORIAL_ACCESS_TOKEN }}" \
77+
https://api.github.com/repos/miykael/nipype_tutorial/actions/runs/${RUN_ID}/cancel

0 commit comments

Comments
 (0)