Skip to content

Commit

Permalink
docs(#592): add documentation about changing the target branch (#613)
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Augustin <[email protected]>
  • Loading branch information
AndreasAugustin authored Feb 10, 2025
1 parent 12d1b4c commit 0f01112
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,17 @@ jobs:
* If the remote repository already contains the source repository changes the action will exit and the output variable will be undefined
* If there are no changes the action will exit and the output variable will be undefined

### Change the target branch

Per default the action is using the default branch as the target. To change this behaviour just add it to the checkout action

```yaml
- name: Checkout
uses: actions/checkout@v4
with:
ref: <target_branch> # defaults to the default branch
```

### Docker

There are docker images available. Please checkout [How to use docker](docs/DOCKER.md) for details.
Expand Down
12 changes: 6 additions & 6 deletions src/sync_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ function gh_login_target_github() {
target_repo_hostname=$(echo "${github_server_url}" | cut -d '/' -f 3)
info "target server url: ${target_repo_hostname}"
info "logging out of the target if logged in"
gh auth logout --hostname "${target_repo_hostname}" || debug "not logged in"
unset GH_TOKEN
gh auth logout --hostname "${target_repo_hostname}" || debug "not logged in"
unset GH_TOKEN
info "login to the target git repository"
gh auth login --git-protocol "https" --hostname "${target_repo_hostname}" --with-token <<< "${TARGET_GH_TOKEN}"
gh auth setup-git --hostname "${target_repo_hostname}"
Expand Down Expand Up @@ -330,7 +330,7 @@ function eventual_create_labels () {
##############################
function push () {
info "push changes"


local branch=$1
local is_force=$2
Expand All @@ -346,10 +346,10 @@ function push () {
if [ "$is_with_tags" == true ] ; then
warn "include tags."
args+=(--tags)
fi
fi

git push "${args[@]}"

}

####################################
Expand Down

0 comments on commit 0f01112

Please sign in to comment.