Skip to content

Commit

Permalink
Improved private template repository docs (#311)
Browse files Browse the repository at this point in the history
* Improved private template repository docs

Signed-off-by: George <31376482+george-gca@users.noreply.github.com>

* Fixed missing link to `test_ssh_gitlab.yml`

Signed-off-by: George <31376482+george-gca@users.noreply.github.com>

* Making usage more clear

Signed-off-by: George <31376482+george-gca@users.noreply.github.com>

---------

Signed-off-by: George <31376482+george-gca@users.noreply.github.com>
Co-authored-by: andy Augustin <AndreasAugustin@users.noreply.github.com>
  • Loading branch information
george-gca and AndreasAugustin authored Feb 13, 2023
1 parent 53177e2 commit 77bb5aa
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ This GitHub action will help you to keep track of the template changes.
* 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. See [.github/workflows/test_ssh_gitlab.yml] for an example.
* different git provider. Default is GitHub, GitLab is also tested. See [.github/workflows/test_ssh_gitlab.yml](.github/workflows/test_ssh_gitlab.yml) for an example.

## Usage

Usage changes depending on whether the template repository is public or private, regardless of the visibility of current repository.

### Public template repository

Add this configuration to your github action
Add this configuration to a github action in the current repository:

```yaml
# File: .github/workflows/template-sync.yml
Expand Down Expand Up @@ -66,15 +68,15 @@ jobs:
pr_labels: <label1>,<label2>[,...] # optional, no default
```
You will receive a pull request within your repository if there are some changes available.
You will receive a pull request within your repository if there are some changes available in the template.
### Private template repository
If you have a private template repository.
If your current repository was created from a private template, there are 2 possibilities.
#### Using github app
#### 1. Using github app
You can create and use a [GitHub App][github-app] to handle the access to your private repository.
You can create and use a [GitHub App][github-app] to handle the access to the private template repository.
To generate a token for your app you can use a separate action like [tibdex/github-app-token][github-app-token].
```yaml
Expand All @@ -99,11 +101,11 @@ jobs:
pr_labels: <label1>,<label2>[,...] # optional, no default
```
#### SSH
#### 2. SSH
You have various options to use ssh keys with GitHub.
An example are [deployment keys][deployment-keys]. For our use case write permissions are not needed.i
Within the repository where the GitHub action is enabled add a secret (e.q. `SOURCE_REPO_SSH_PRIVATE_KEY`) with the content of your private SSH key.
An example are [deployment keys][deployment-keys]. For our use case write permissions are not needed.
Within the current repository, where the GitHub action is enabled, add a secret (e.q. `SOURCE_REPO_SSH_PRIVATE_KEY`) with the content of your private SSH key.
Make sure that the read permissions of that secret fulfil your use case.
Set the optional `source_repo_ssh_private_key` input parameter.
It is also possible to use a different git provider, e.g. GitLab.
Expand Down

0 comments on commit 77bb5aa

Please sign in to comment.