gce-github-runner
gce-github-runner copied to clipboard
If you cancel the workflow during the `create-runner` it won't delete the worker
If you have 2 stage workflow: create-runner and run + post delete worker, and you cancel the workflow during the create-runner stage, it won't delete the worker. If needed, a workaround could be to have an explicit stop-worker stage.
FYI we have this internally handled by having a reusable workflow to create runner, and handle cancel there via something similar to:
<TRUNCATED>
...
- uses: google-github-actions/auth@v1
if: cancelled()
- uses: google-github-actions/setup-gcloud@v1
if: cancelled()
- name: Delete runner VM
if: cancelled()
run: >
gcloud compute instances delete
gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }}
--quiet