derberg / manage-files-in-multiple-repositories

GitHub Action that introduces support for global workflows. Global workflows are the one you update in just one repo and they are automatically updated in other repositories.
MIT License
51 stars 18 forks source link

feat!: enable files removal and action rename #48

Closed derberg closed 1 year ago

derberg commented 1 year ago

Resolves https://github.com/derberg/copy-files-to-other-repositories/issues/46 Resolves https://github.com/derberg/copy-files-to-other-repositories/issues/45

once this PR is merged I rename repo to manage-files-in-multiple-repositories and the same the action. I will also release it as v2.

@ReenigneArcher @Tjitse-E please lemme know if you want to review or test before merge


Tests

Case 1

patterns_to_include: CODE_OF_CONDUCT.md,CONTRIBUTING.md
patterns_to_remove: .github/workflows

Expected error:

Error: Fields patterns_to_include and patterns_to_remove are mutually exclusive. If you want to remove files from repos then do not use patterns_to_include.
##[debug]Node Action run completed with exit code 1

Case 2

patterns_to_ignore: .github/workflows/global-workflow.yml,.github/workflows/bump-on-release.yml
patterns_to_remove: .github/workflows

Expected result: bump-on-release.yml is not removed first-time-contrib.yml is removed

  Removing files
  ##[debug]DEBUG: Removing files from root /home/runner/work/.github/.github/clones/nie-niet-none Where process.cwd() is /home/runner/work/.github/.github
  ##[debug]DEBUG: Provided patterns .github/workflows relate to the following files .github/workflows/first-time-contrib.yml

PRs:

Case 3

Expected that PR will be created where 1 files will be deletion and 1 addition and 1 modification

patterns_to_ignore: .github/workflows/global-workflow.yml,.github/workflows/bump-on-release.yml
patterns_to_include: .github/workflows

changed in global repo -> https://github.com/lukasz-lab/.github/commit/7dd363b2a8f8e93bdfae9aec293db18573b31fc9 got PR -> https://github.com/lukasz-lab/piontek/pull/56/files

also one operation, like only addition with no removal also works https://github.com/lukasz-lab/piontek/pull/54/files