platformsh / template-builder

Utilities to manage Platform.sh project templates
https://github.com/platformsh-templates
MIT License
15 stars 31 forks source link

[TB clean-up] Resolve ours vs theirs .github directory #882

Closed gilzow closed 1 year ago

gilzow commented 1 year ago

Closes #881 Previously, individual template classes were manually removing the .github directory, along with other CI-related services (e.g. .circleci, .tugboat, etc.). However, that meant our .github directory was also being removed.

This PR attempts to resolve this issue of theirs vs our .github directory:

  1. after cloning our template repository, checks for the existence of a .github directory, and if present, renames to tmp.github
  2. after pulling from the upstream, if a .github directory is reintroduced, deletes it
  3. then if our tmp.github directory exists, renames it back to .github

This occurs during the update action, before the platformify action which allows us to preserve the all/common/.github and all/sourceop-auto-update/.github contents as the source of truth while also preserving additional workflow files from individual template repositories (e.g. .github/tests/vrt/* files)

This PR also removes the deletion of the .github directory from the following template classes: