You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**GitLab Sync** is a easy to use github action for syncing code to gitlab.
3
+
**GitLab Sync** is a GitHub Action designed for straightforward synchronization of code from a GitHub repository to a GitLab repository.
4
4
5
-
## My Motivation
5
+
## Motivation
6
6
7
-
I was sick of all the not working github actions so I just hacked one myself lol
7
+
This GitHub Action was developed to provide a reliable and easy-to-use solution for syncing repositories between GitHub and GitLab, addressing common challenges found in existing solutions.
8
8
9
9
## How to Use
10
10
11
-
To use this github action follow these steps below!
11
+
Follow these steps to integrate this GitHub Action into your workflow:
12
12
13
-
### Step 1: Set Up Secrets in GitHub
13
+
### Step 1: Configure GitHub Secrets
14
14
15
+
Before using the action, you need to add the following secrets to your GitHub repository's settings:
15
16
16
-
-`GITLAB_URL`: The URL of your GitLab repository (e.g., `https://gitlab.com/yourusername/yourrepo.git`).
17
+
-`GITLAB_URL`: The HTTPS URL of your GitLab repository (e.g., `https://gitlab.com/yourusername/yourrepo.git`).
17
18
-`USERNAME`: Your GitLab username.
18
-
-`GITLAB_PAT`: Your GitLab Personal Access Token.
19
+
-`GITLAB_PAT`: Your GitLab Personal Access Token with appropriate permissions to push to the repository.
19
20
20
21
### Step 2: Add the Workflow to Your GitHub Repository
21
22
22
-
Create a `.github/workflows/action.yml` file in your repository and add the following workflow configuration:
23
+
Create a workflow file (e.g., `.github/workflows/sync-to-gitlab.yml`) in your GitHub repository with the following configuration:
23
24
24
25
```yaml
25
26
name: Sync Repo to GitLab
@@ -31,31 +32,34 @@ jobs:
31
32
sync:
32
33
runs-on: ubuntu-latest
33
34
steps:
34
-
- uses: keninkujovic/gitlab-sync@2.0.0
35
+
- name: Sync to GitLab
36
+
uses: keninkujovic/gitlab-sync@2.0.0
35
37
with:
36
38
gitlab_url: ${{ secrets.GITLAB_URL }}
37
39
username: ${{ secrets.USERNAME }}
38
40
gitlab_pat: ${{ secrets.GITLAB_PAT }}
39
41
```
40
42
43
+
**Note:** It's recommended to specify which branches trigger the sync (e.g., `main`, `master`) and to include `actions/checkout@v3` (or a newer version) to ensure the action has access to your repository's content. Using `fetch-depth: 0` ensures all history is fetched, which is often necessary for a clean sync.
44
+
41
45
### Step 3: Push Changes to GitHub
42
46
43
-
Now you just need to push to GitHub and all the changes will be synced to Gitlab!
47
+
Once the workflow is set up, any push to the configured branches in your GitHub repository will automatically trigger the synchronization process to your GitLab repository.
44
48
45
49
## Inputs
46
50
47
-
Here are the required inputs
51
+
The following inputs are required for this action:
48
52
49
-
- `gitlab_url`: The URL of your GitLab repository.
50
-
- `username`: Your GitLab username.
51
-
- `gitlab_pat`: Your Personal Access Token for GitLab.
53
+
- `gitlab_url`: (Required) The HTTPS URL of your GitLab repository.
54
+
- `username`: (Required) Your GitLab username.
55
+
- `gitlab_pat`: (Required) Your GitLab Personal Access Token. Ensure this token has sufficient permissions to write to the target GitLab repository.
52
56
53
57
## Feedback and Contributions
54
58
55
-
Your feedback and contributions are welcome! Feel free to open an issue or submit a pull request in my repository.
59
+
Feedback and contributions are highly valued. Please feel free to open an issue for bug reports or feature requests, or submit a pull request with improvements.
56
60
57
-
Also if you like the actions star it!
61
+
If you find this action useful, consider starring the repository!
58
62
59
63
## Disclaimer
60
64
61
-
This was built in need and not tested properly.
65
+
This action was developed to fulfill a specific need. While it has been tested, users should verify its functionality in their own environments. Please use it at your own discretion.
0 commit comments