Skip to content

Commit

Permalink
Docs/enhance docs (#322)
Browse files Browse the repository at this point in the history
* doc: 📝 enhance documentation (#226)

* doc: 📝 enhance documentation (#226)

* doc: 📝 enhance documentation (#226)
  • Loading branch information
AndreasAugustin authored Feb 19, 2023
1 parent f7cde4f commit 42bd613
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 17 deletions.
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,41 @@

## abstract

Synchronise git repositories in an automated manner. Different git providers liek GitHub (enterprise), GitLab,.. are supported as the source provider.
This can help you e.g. for migration from another git provider to GitHub or if you want to mirror git repositories.

### History

It is possible to create repositories within Github with
[GitHub templates](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-template-repository).
This is a nice approach to have some boilerplate within your repository.
Over the time the template repository will get some code changes.
The problem is that the already created repositories won't know about those changes.
This GitHub action will help you to keep track of the template changes.
In addition it is possible to sync all other git repositories.
This can help you e.g. for migration from another git provider to GitHub or if you want to mirror git repositories.
The initial author of this repository faced that issue several times and decided to write a github action to face that issue.
Because of the nice community, several feature requests helped to go on with development of the action. Now several other features are supported.

## Features

```mermaid
flowchart LR
github_source("<b>GitHub</b> source repository <b>[private|public]</b>")
gitlab_source("<b>GitLab</b> source repository <b>[private|public]</b>")
any_source("<b>Any</b> git provider <b>[private|public]</b>")
github_target{{"<b>GitHub</b> target repository <b>[private|public]</b>"}}
github_source --> |"supported: [ssh|pat|github app]"| github_target
gitlab_source --> |"supported: [ssh]"| github_target
any_source --> |"supported: [ssh]"| github_target
github_source("fa:fa-github <b>GitHub</b> source repository <b>[private|public]</b>")
gitlab_source("fa:fa-gitlab <b>GitLab</b> source repository <b>[private|public]</b>")
any_source("fa:fa-git <b>Any</b> git provider <b>[private|public]</b>")
github_target{{"fa:fa-github <b>GitHub</b> target repository <b>[private|public]</b>"}}
github_source --> |"<b>ssh | PAT | github app</b>"| github_target
gitlab_source --> |"<b>ssh</b>"| github_target
any_source --> |"<b>ssh</b>"| github_target
```

* Sync other public or private repository (e.g. template repositories) with the current repository
* Ignore files and folders from syncing using a `.templatesyncignore` file
* many configuration options
* different lifecycle hooks are supported
* different git provider. Default is GitHub, GitLab is also tested with ssh.
* different lifecycle hooks are supported. This opens the possibility to inject custom code into the workflow with a yaml definition file.
* different git provider like GitLab, Gittea,.. as source are supported (with ssh).
See [.github/workflows/test_ssh_gitlab.yml](.github/workflows/test_ssh_gitlab.yml) for an example.
* It is not necesarly needed that source and target repository have same base history.
Because of that reason it is possible to merge 2 total different repositories with the help of the action.

## Usage

Expand Down
13 changes: 7 additions & 6 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## abstract

within this section you will find some
within this section you will find some information about the code flow

## Code

Expand All @@ -12,7 +12,7 @@ The architecture and logic within the code:
flowchart TD
Exit[Exit]
Start[Start]
GitHubActionEnv{Read GitHubAction env}
GitHubActionEnv{"fa:fa-github Read GitHubAction env"}
style Start fill:#f9f,stroke:#333,stroke-width:4px
style Exit fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
Expand All @@ -26,17 +26,18 @@ EnvCheckSync{Required environment variables exists}
SshConfigureSync[Eventually configure SSH variables]
SetVariablesSync[Set the needed variables, e.q. with reading remote repository]
CheckCommitLocalExistent{"Check if source commit hash is present in target repo"}
GitCheckoutSync["Create git branch <branch_prefix_git_hash>"]
GitCheckoutSync["fa:fa-code-branch Create git branch <branch_prefix_git_hash>"]
GitPullSync["Pull from remote repository"]
CheckIgnoreFileExistsSync{"Check if .templatesyncignore file exists\n(First inside .github folder, then in root)"}
ResetChangesSync["Reset the changes listed within the ignore file"]
GitCommitSync["Commit the changes"]
GitCommitSync["fa:fa-code-commit Commit the changes"]
CheckIsDryRun{"Check if is_dry_run is set to true"}
GitPushSync["Push the changes to GitHub"]
GitPullRequestSync["Create a pull request on GitHub"]
GitPullRequestSync["fa:fa-code-pull-request Create a pull request on GitHub"]
Hook{{"hooks, <b>prepush | prepush | prepr</b>"}}
subgraph githubactions["GitHubActions"]
subgraph githubactions["fa:fa-github GitHubActions"]
Start --> GitHubActionEnv
GitHubActionEnv -->|issues| Exit
Expand Down
11 changes: 11 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,15 @@

Within this section you can find some more detailed doumentation.

```mermaid
flowchart LR
github_source("fa:fa-github <b>GitHub</b> source repository <b>[private|public]</b>")
gitlab_source("fa:fa-gitlab <b>GitLab</b> source repository <b>[private|public]</b>")
any_source("fa:fa-git <b>Any</b> git provider <b>[private|public]</b>")
github_target{{"fa:fa-github <b>GitHub</b> target repository <b>[private|public]</b>"}}
github_source --> |"<b>ssh | PAT | github app</b>"| github_target
gitlab_source --> |"<b>ssh</b>"| github_target
any_source --> |"<b>ssh</b>"| github_target
```

- [architecture](./ARCHITECTURE.md)

0 comments on commit 42bd613

Please sign in to comment.