Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SRE-410 FEAT bootstrap gha-file-sync (#1)
* base for git-file-sync * add action.yml * make GITHUB_TOKEN required for the gha * print debug for REPOSITORIES env check * bind action.yaml input to Docker container env * some first steps * dont forget to commit the root * udpate go.mod * add go.sum consideration in Dockerfile * first main step * commit go modules files * install glibc compatibility packages for the alpine image * bind FILE_SYNC_BRANCH_REGEXP * add Makefile for easy local testing * split config into a dedicated package, add debug * add debug for commit message * avoid print of clone progress on stdout * replaced PickBranchToCompare to SetHeadBranch, improve HasChanged, started UpdateHeadBranch * implement UpdateRemote * disable dry-run to test * improve logging, add debug * increase max commit size to 120, improve debug around pickbasebranch * improve format of branch names, avoid creation of branch in updateremote * improve format of branch names * fix Dockerfile debug, add hardcoded commit author * add PR_TITLE option, create PR mode * try to revert dynamical create mode * did not work * ignore local testing files * git plumb correctly, upgrade go to 1.20 * quick refacto/chore * cap pr title max size to 100, small reverts on checkout and push options * add CODEOWNERS file, improve default pr title and commit message * enable CGO in Dockerfile * add author retrieval and use it in commit * make GetCurrentUsernameAndEmail more resilient * re-enable pr comments * improve desc on pr updates * fix broken pointer assignment for existing PR number * fix: instantiate existingPrNumber pointer before assignement * refactorize code in a more modular way * refactorize code in main.go * improve logging of config * fix: invert isNewBranch computation * improve semantic of GetBranchNameByPRNumbers * fix: invert IsSetup check * comment Dryrun for testing purpose * stop using os.Chdir * handle both master and main as base default branch * rename git-file-sync to github-file-sync considering the coupling * improve README * docs about pr page size * uncomment dryrun condition * fix typo in PickSyncBranch coms * improve readability of the getbasebranchname * improve the readme * Update internal/github/helpers.go * Update README.md Co-authored-by: sven <[email protected]> * Update internal/sync/manager.go Co-authored-by: sven <[email protected]> * Update internal/cfg/config.go Co-authored-by: sven <[email protected]> * chore: name more explicitly the task variable * lint: rename mygit package to git * Update internal/sync/task.go Co-authored-by: sven <[email protected]> * Update internal/sync/task.go Co-authored-by: sven <[email protected]> * improve overall by using linter rules * remove unused golangci-lint comment * add lint in Makefile * change LICENSE to CC by 4.0 * add lint workflows * fix dereference of a nil pointer in config * set golang in .tool-versions * remove misleading skeleton for local testing * delete license temporarly * add info about removal of files in README * rewrite comment --------- Co-authored-by: sven <[email protected]>
- Loading branch information