Skip to content

Add support for delete_source_branch_on_merge configuration option#418

Open
Smirl wants to merge 1 commit intotranscend-io:masterfrom
Smirl:delete-source-branch-on-merge
Open

Add support for delete_source_branch_on_merge configuration option#418
Smirl wants to merge 1 commit intotranscend-io:masterfrom
Smirl:delete-source-branch-on-merge

Conversation

@Smirl
Copy link

@Smirl Smirl commented Jan 13, 2026

Summary

closes #417

This pull request adds support for a new CLI flag and configuration option to automatically delete the source branch after merging, enhancing workflow automation. It updates the documentation, command-line interface, configuration struct, and tests to include this new feature.

New feature: Delete source branch on merge

  • Added a --delete-source-branch-on-merge CLI flag to the generate command, allowing users to enable automatic deletion of the source branch after a merge.
  • Updated the AtlantisConfig struct to include a DeleteSourceBranchOnMerge field, and ensured this value is set when generating configuration. [1] [2]
  • Documented the new flag in the README.md CLI options table.

Testing and test data

  • Added a test case (TestEnablingDeleteSourceBranchOnMerge) to verify that the new flag and configuration option work as expected.
  • Included a new golden file (withDeleteSourceBranchOnMerge.yaml) to support automated testing of this feature.
  • Updated test setup to ensure the new flag is reset between test runs.

Implements support for the Atlantis `delete_source_branch_on_merge`
configuration option to automatically delete source branches after merging.

Changes:
- Add DeleteSourceBranchOnMerge field to AtlantisConfig struct
- Add --delete-source-branch-on-merge CLI flag (defaults to false)
- Update README with flag documentation
- Add test case and golden file for the new feature
- All existing tests pass

Fixes transcend-io#417

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Smirl
Copy link
Author

Smirl commented Jan 13, 2026

Hey @Almenon
Small PR here to add a new feature. I saw that there was an open issue for it already which this should close.
Thanks in advance 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support delete_source_branch_on_merge configuration option

1 participant