repo-sync / github-sync

⤵️ A GitHub Action for syncing current repository with remote
https://github.com/marketplace/actions/github-repo-sync
MIT License
393 stars 103 forks source link

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

Open oldking139 opened 1 year ago

oldking139 commented 1 year ago

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.

peterbe commented 1 year ago

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

heiskr commented 1 year ago

We welcome community contributions.