Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.
/ action-cross-commit Public archive

Commits files to a different target repo

License

Notifications You must be signed in to change notification settings

drud/action-cross-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cross Commit

Github action that allows synchronizing parts of repositories. It runs rsync between source folder in current repository to destination repository and destination folder and creates a commit in destination repository. Typical usage is for synchronizing to GitOps state repositories from source code.

Usage

See action.yml

Example:

steps:
- name: Commit to state repository
  uses: drud/action-cross-commit@master
  with:
    source-folder: config
    destination-repository: https://<user>:${{ secrets.user_token }}@github.com/org/dest-repo
    destination-folder: .
    destination-branch: alpha
    git-user: "Git User"
    git-user-email: [email protected]
    git-commit-message: "Custom commit message (optional)"
    git-commit-sign-off: "false"
    excludes: README.md:.git:path/deeper/in/the/repo

The example above will trigger rsync that will synchronize the files in ./config to repository github.com/org/dest-repo root using user credentials (can be stored as Github secrets) and create commit on alpha branch. The rsync will exclude /.git, /README.md and /path/deeper/in/the/repo from both repositories during the synchronization.

License

This project is licensed under Apache 2.0 license. Read the LICENSE file in the top distribution directory, for the full license text.