Skip to content

πŸ”„ Github action to sync your forks

License

Notifications You must be signed in to change notification settings

kasbah/fork-sync

This branch is 77 commits behind tgymnich/fork-sync:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0377ac6 Β· Feb 10, 2022
Oct 27, 2021
Sep 4, 2019
Oct 27, 2021
Oct 30, 2021
Sep 4, 2019
Sep 4, 2019
Feb 10, 2022
Oct 27, 2021
Oct 27, 2021
Oct 27, 2021
Sep 4, 2019

Repository files navigation

Fork Sync

Build Version

Github action to sync your Forks. This action uses octokit and the GitHub API to automatically create and merge a pull request with the head defined by head into the base defined by base. The head branch owner is defined by owner. If you create a PR in the same repository you can omit the owner parameter.

Example Workflow

name: Sync Fork

on:
  schedule:
    - cron: '*/30 * * * *' # every 30 minutes
  workflow_dispatch: # on button click

jobs:
  sync:

    runs-on: ubuntu-latest

    steps:
      - uses: tgymnich/fork-sync@v1.6.3
        with:
          owner: llvm
          base: master
          head: master

Auto approve

If you use a workflow which does not allow to merge pull requests without a review ("Require pull request reviews before merging" in your repo settings) you can set auto_approve to true. In that case you'll have to provide a personal access token for a user which is allowed to review the pull requests changes. Make sure the token has at least public_repo permissions and store the token inside of the repository secrets.

An example workflow would then look like this:

name: Sync Fork

on:
  schedule:
    - cron: '*/30 * * * *' # every 30 minutes
  workflow_dispatch: # on button click

jobs:
  sync:

    runs-on: ubuntu-latest

    steps:
      - uses: tgymnich/fork-sync@v1.6.3
        with:
          token: ${{ secrets.PERSONAL_TOKEN }}
          owner: llvm
          base: master
          head: master

Parameters

name Optional Default description
owner βœ… $current_repo_owner Owner of the forked repository
token βœ… ${{ github.token }} Token to access the Github API
head βœ… master Head branch
base βœ… master Base branch
merge_method βœ… merge merge, rebase or squash
pr_title βœ… Fork Sync Title of the created pull request
pr_message βœ… Message of the created pull request
ignore_fail βœ… Ignore Exceptions

⚠️ $current_repo_owner is your own username!

⚠️ Only provide the branch name for head and base. user:branch will not work!

⚠️ * if auto_approve is set to true you must provide a personal access token in token the default github token won't work!

About

πŸ”„ Github action to sync your forks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 62.7%
  • TypeScript 37.3%