runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.82k stars 1.06k forks source link

Automatically run atlantis unlock when a Bitbucket PR is declined #3761

Open dbaboy opened 1 year ago

dbaboy commented 1 year ago

Discussed in https://github.com/runatlantis/atlantis/discussions/3757

Originally posted by **dbaboy** September 9, 2023 I am looking for a functionality where declining the PR will automatically run 'atlantis unlock' - like on a hook into decline. This is avoid having to run the unlock manually. Can someone confirm if they have this working. FYI - The Webhooks are configured as per https://www.runatlantis.io/docs/configuring-webhooks.html#bitbucket-cloud-bitbucket-org NOTE: This was initially asked [here](https://github.com/runatlantis/atlantis/pull/2916#issuecomment-1711635493)
dbaboy commented 1 year ago

As I understand, this needs to happen in Atlantis events. So, when a PR is declined and the Webhook on Declined is triggered, Atlantis must then fire a 'atlantis unlock'.

mtavaresmedeiros commented 1 year ago

humm, looks like a nice thing.

let me check if I can do anything about it.

mtavaresmedeiros commented 1 year ago

actually, the atlantis already do it:

{"level":"info","ts":"2023-10-13T15:10:22.235Z","caller":"events/events_controller.go:371","msg":"identified event as type \"closed\"","json":{}}
{"level":"info","ts":"2023-10-13T15:10:22.236Z","caller":"events/instrumented_pull_closed_executor.go:45","msg":"Initiating cleanup of pull data.","json":{"repository":"***","pull-num":"5"}}
{"level":"info","ts":"2023-10-13T15:10:22.236Z","caller":"events/working_dir.go:385","msg":"Deleting repo pull directory: "****","json":{}}
{"level":"info","ts":"2023-10-13T15:10:22.240Z","caller":"events/events_controller.go:478","msg":"deleted locks and workspace for repo ***, pull 5","json":{}}

Is it not working for you?