Skip to content

๐Ÿ”„ Simplify collaboration and development by efficiently syncing the latest updates from another repository with the Git Sync from 90dy GitHub Action.

License

Notifications You must be signed in to change notification settings

90dy/gha-git-sync

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Git Sync Github Action

GitHub Workflow Status GitHub release (latest SemVer)

This GitHub Action enables you to synchronize the latest changes from another repository, streamlining your development process.

Usage

To use this GitHub Action, add the following YAML code to your workflow file (e.g., .github/workflows/git-sync.yml):

name: Git Sync

on:
  push:
    branches:
      - main

jobs:
  sync:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Code
        uses: actions/checkout@v4
        with:
          branch: main # Branch to sync in

      - name: Git Sync
        uses: 90dy/gha-git-sync@v1
        with:
          repository: '' # Repository to pull from
          branch: '' # Branch to sync from
          user-email: '' # Git user email
          user-name: '' # Git user name
          paths: | # File path to sync (not directories)
            file-a.txt
            file-b.txt
          commit-message: '' # Commit message
          assignees: '' # A comma or newline-separated list of assignees (GitHub usernames)
          remote: '' # The name of the remote to fetch from.

You can configure the following inputs based on your requirements:

  • repository: The repository to pull changes from.
  • branch: The branch to sync.
  • user-email: Your Git user email.
  • user-name: Your Git user name.
  • paths: (Optional) File path to sync (not directories).
  • commit-message: (Optional) Commit message.
  • assignees: (Optional) A comma or newline-separated list of assignees (GitHub usernames).
  • remote: (Optional)` The name of the remote to fetch from.

Workflow

  1. Set the committer information in the Git configuration.
  2. Fetch the changes from the specified repository and branch.
  3. Checkout to a branch where to make change.
  4. Attempt to rebase the changes.
  5. If the rebase is successful, merge the changes into the current branch.
  6. If the merge is successful, push the changes to the current branch.
  7. If the rebase fails, abort the process.
  8. If the abort is successful, create a pull request to sync the changes.

License

This GitHub Action is licensed under the Unlicense License. See the LICENSE file for details.

About

๐Ÿ”„ Simplify collaboration and development by efficiently syncing the latest updates from another repository with the Git Sync from 90dy GitHub Action.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project