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

In a failFast configuration need to be able to stop the build. #12

Open
seebees opened this issue Jan 28, 2020 · 4 comments
Open

In a failFast configuration need to be able to stop the build. #12

seebees opened this issue Jan 28, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@seebees
Copy link
Collaborator

seebees commented Jan 28, 2020

No description provided.

@mattsb42-aws mattsb42-aws added the enhancement New feature or request label Feb 1, 2020
@lackhoa
Copy link

lackhoa commented May 27, 2021

I think this is a simple but crucial feature. Sometimes you need to stop the build in gha before it does something stupid. But since now codebuild will continue anyway it would be very dangerous.

@luzhkovvv
Copy link

I can add another use case. We execute some long-running (up to 2-3 hours) tests in CodeBuild, and use GH workflow on workflow_dispatch to manually trigger that execution.
If the person who triggered execution sees in logs something wrong and cancels workflow (so errors could be fixed and workflow triggered again), CodeBuild continues to run and we have to wait for several hours until it finishes to free up other system resources, consumed in that execution.
It would be nice to be able to cancel running CodeBuild job if the workflow is canceled.

@akazakou
Copy link

akazakou commented Jul 23, 2022

It was already implemented in dark-mechanicum/aws-codebuild action. If you'll click "Cancel Workflow" from GHA interface, it will automatically cancel AWS CodeBuild job

@pbrisbin
Copy link
Contributor

pbrisbin commented Jul 7, 2023

This would be a great feature. We maintain a call-jenkins-from-GHA action and it was pretty easy to catch SIGINT (which GitHub sends on cancellation) and stop the build we're tailing.

When moving from Jenkins to CodeBuild and using this action, we planned to implement this with our own step using the cancelled() expression:

steps:
  - id: build
    uses: aws-actions/aws-codebuild-run-build@v1
    with:
      # ...
      
  - if: ${{ cancelled() }}
    run: |
      aws codebuild stop-build --id ${{ steps.build.outputs.aws-build-id }}

We'll be trying this soon, but has anyone else done this or know if it will/won't work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants