Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If you cancel the workflow during the create-runner it won't delete the worker #10

Open
ravwojdyla opened this issue Sep 29, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@ravwojdyla
Copy link
Contributor

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.

@ravwojdyla ravwojdyla added the bug Something isn't working label Sep 29, 2021
@ravwojdyla
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant