diff --git a/README.md b/README.md index 69641bd..0a1b057 100644 --- a/README.md +++ b/README.md @@ -30,14 +30,15 @@ Configure the action with a branch on your `target` repo - the one you want to u ### Input Variables -| Name | Required? | Default | Example | -| -------------------------- | :----------------: | ------- | ---------------------------------------- | -| target_sync_branch | :white_check_mark: | | 'master', 'main', 'my-branch' | -| target_repo_token | :white_check_mark: | | ${{ secrets.GITHUB_TOKEN }} | -| upstream_repo_access_token | | | ${{ secrets.NAME_OF_TOKEN }} | -| upstream_sync_repo | :white_check_mark: | | 'aormsby/Fork-Sync-With-Upstream-action' | -| upstream_sync_branch | :white_check_mark: | | 'master', 'main', 'my-branch' | -| test_mode | | false | true / false | +| Name | Required? | Default | Example | +| -------------------------- | :----------------: | ------------ | ---------------------------------------- | +| target_host_domain | | 'github.com' | 'codeberg.org' | +| target_sync_branch | :white_check_mark: | | 'master', 'main', 'my-branch' | +| target_repo_token | :white_check_mark: | | ${{ secrets.GITHUB_TOKEN }} | +| upstream_repo_access_token | | | ${{ secrets.NAME_OF_TOKEN }} | +| upstream_sync_repo | :white_check_mark: | | 'aormsby/Fork-Sync-With-Upstream-action' | +| upstream_sync_branch | :white_check_mark: | | 'master', 'main', 'my-branch' | +| test_mode | | false | true / false | **Always** set `target_repo_token` to `${{ secrets.GITHUB_TOKEN }}` so the action can push to your target repo. diff --git a/action.yaml b/action.yaml index 3efbd2c..82eff4a 100644 --- a/action.yaml +++ b/action.yaml @@ -72,6 +72,11 @@ inputs: required: true default: 'github.com' + target_host_domain: + description: 'Domain name to be used in target repo URL.' + required: false + default: 'github.com' + shallow_since: description: 'Length of time used when fetching shallow repo data, should match how often you perform a sync' required: true diff --git a/run/push_updates.sh b/run/push_updates.sh index 3e0f1a4..528ff57 100644 --- a/run/push_updates.sh +++ b/run/push_updates.sh @@ -7,7 +7,7 @@ push_new_commits() { # TODO: figure out how this would work in local mode... # update remote url with token since it is not persisted during checkout step when syncing from a private repo if [ -n "${INPUT_TARGET_REPO_TOKEN}" ]; then - git remote set-url origin "https://${GITHUB_ACTOR}:${INPUT_TARGET_REPO_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" + git remote set-url origin "https://${GITHUB_ACTOR}:${INPUT_TARGET_REPO_TOKEN}@${INPUT_TARGET_HOST_DOMAIN}/${GITHUB_REPOSITORY}.git" fi # shellcheck disable=SC2086