How about instead of a script we'd make it a GitHub workflow called "Prune deployed branches" that will remove either everything under the branches/directory under GH pages Branch or a selected feature branch via a workflow dispatch on the GitHub actions user interface.
The workflow should be dispatched from the GitHub user interface. Script should be very cautious and ensure that it is executing on the GH pages Branch and that it is executing in the proper directory
Squash commit to remove the history and do whatever is possible to reduce the size of the branch and the commit log/history and keep the repo small
How about instead of a script we'd make it a GitHub workflow called "Prune deployed branches" that will remove either everything under the branches/directory under GH pages Branch or a selected feature branch via a workflow dispatch on the GitHub actions user interface.
The workflow should be dispatched from the GitHub user interface. Script should be very cautious and ensure that it is executing on the GH pages Branch and that it is executing in the proper directory
Squash commit to remove the history and do whatever is possible to reduce the size of the branch and the commit log/history and keep the repo small