github-sync icon indicating copy to clipboard operation
github-sync copied to clipboard

[Feature Request] Allow destination with custom domain (GHES)

Open oldking139 opened this issue 1 year ago • 2 comments

When I using Github enterprise server with our custom domain, we can simply fetch repo from github.com, but when pushing to internal repo, the error log shows:

fatal: repository 'https://github.com/<org-name>/<repo-name>/' not found

In fact, the behavior is right because we do not have that repo on github.com, but only in our Github enterprise server.

I create this actions file in our internal repo in our Github enterprise server to sync from github.com.

name: Sync from Github.com

on:
    schedule:
    - cron:  "*/15 * * * *"
    workflow_dispatch:

jobs:
    repo-sync:
      runs-on: ubuntu-latest
      steps:
      - uses: actions/checkout@v3
        with:
          persist-credentials: false
      - name: repo-sync
        uses: repo-sync/github-sync@v2
        with:
          source_repo: "${{secrets.SOURCE_REPO}}"
          source_branch: "*"
          destination_branch: "*"
          github_token: ${{ secrets.PAT }}
          sync_tags: "true"

As we using custom domain rather than github.com, I think it is good to have an option to change the prefix or the full repository name before we set the "destination branch", for example, add a destination_repo option in actions.

oldking139 avatar Oct 14 '23 09:10 oldking139

@repo-sync/reviewers can you assign this to yourself?

peterbe avatar Oct 23 '23 14:10 peterbe

We welcome community contributions.

heiskr avatar Oct 30 '23 15:10 heiskr