{"id":13626215,"url":"https://github.com/aormsby/Fork-Sync-With-Upstream-action","last_synced_at":"2025-04-16T11:31:33.448Z","repository":{"id":39922952,"uuid":"286375621","full_name":"aormsby/Fork-Sync-With-Upstream-action","owner":"aormsby","description":"An action to automatically update your fork with new commits from the upstream repo","archived":false,"fork":false,"pushed_at":"2024-03-09T21:52:34.000Z","size":311,"stargazers_count":272,"open_issues_count":16,"forks_count":76,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T22:02:17.014Z","etag":null,"topics":["fork","integration","submodule","sync","upstream","workflow"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aormsby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-08-10T04:28:30.000Z","updated_at":"2025-04-02T21:10:35.000Z","dependencies_parsed_at":"2024-03-09T22:29:59.081Z","dependency_job_id":null,"html_url":"https://github.com/aormsby/Fork-Sync-With-Upstream-action","commit_stats":{"total_commits":105,"total_committers":13,"mean_commits":8.076923076923077,"dds":"0.32380952380952377","last_synced_commit":"504db13f341b88fe69e8079aab870f45a81cdab0"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aormsby%2FFork-Sync-With-Upstream-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aormsby%2FFork-Sync-With-Upstream-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aormsby%2FFork-Sync-With-Upstream-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aormsby%2FFork-Sync-With-Upstream-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aormsby","download_url":"https://codeload.github.com/aormsby/Fork-Sync-With-Upstream-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249235070,"owners_count":21235143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fork","integration","submodule","sync","upstream","workflow"],"created_at":"2024-08-01T21:02:13.084Z","updated_at":"2025-04-16T11:31:33.162Z","avatar_url":"https://github.com/aormsby.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Github Action: Upstream Sync\n\n## About\n\nAn action with forks in mind! Automatically sync a branch on your fork with the latest commits from the original repo. It should work to keep any two branches in sync. Keep all your things up to date!\n\n## Support This Project\n\nThis project is not currently in active development, but code contributions are always welcome.\n\nI encourage you to share projects using Fork Sync in the Users file. Open a PR against Users so others can check out your work!\n\n\u003e [USERS.md](/USERS.md)\n\nIf you would like to see more updates to this project, please consider taking a brief survey to help me understand your needs. Thank you, and happy coding.\n\n\u003e [Fork Sync - Developer Survey](https://forms.gle/pNGkmDWBidcu3BnPA)\n\n## Intended Workflow\n\nThis action was made to keep **non-working** branches up to date with a remote repo. However, you should also be able to use it for branches under active development as long as the custom input supports your needs.\n\nConfigure the action with a branch on your `target` repo - the one you want to update - and a branch on your `upstream` repo - where the updates are coming from. This action checks out those branches on both repos, checks for any new commits (by hash comparison), and pulls those new commits from upstream to the target. Easy!\n\n\u003cimg src=\"img/fork-sync-diagram.png\" alt=\"sample git workflow\"\u003e\n\n## How to Use\n\n[Add a workflow](https://docs.github.com/en/actions/quickstart#creating-your-first-workflow) to your repo that includes this action ([sample below](#sample-workflow)). Please note that scheduled workflows only run on the default branch of a repo.\n\n### Input Variables\n\n| Name                       |     Required?      | Default | Example                                  |\n| -------------------------- | :----------------: | ------- | ---------------------------------------- |\n| target_sync_branch         | :white_check_mark: |         | 'master', 'main', 'my-branch'            |\n| target_repo_token          | :white_check_mark: |         | ${{ secrets.GITHUB_TOKEN }}              |\n| upstream_repo_access_token |                    |         | ${{ secrets.NAME_OF_TOKEN }}             |\n| upstream_sync_repo         | :white_check_mark: |         | 'aormsby/Fork-Sync-With-Upstream-action' |\n| upstream_sync_branch       | :white_check_mark: |         | 'master', 'main', 'my-branch'            |\n| test_mode                  |                    | false   | true / false                             |\n\n**Always** set `target_repo_token` to `${{ secrets.GITHUB_TOKEN }}` so the action can push to your target repo.\n\n\u003e For more information on optional input variables, advanced configurations, and working with private repos, see [Wiki - Configuration](https://github.com/aormsby/Fork-Sync-With-Upstream-action/wiki/Configuration)\n\n### Output Variables\n\n| Name            | Output     | Description                                                                                                     |\n| --------------- | ---------- | --------------------------------------------------------------------------------------------------------------- |\n| has_new_commits | true/false | Outputs true if new commits were found in the remote repo, false if target repo already has the latest updates. |\n\nIf you need more output data, please open an issue to request it.\n\n## Sample Workflow\n\n```yaml\nname: 'Upstream Sync'\n\non:\n  schedule:\n    - cron:  '0 7 * * 1,4'\n    # scheduled at 07:00 every Monday and Thursday\n\n  workflow_dispatch:  # click the button on Github repo!\n    inputs:\n      sync_test_mode: # Adds a boolean option that appears during manual workflow run for easy test mode config\n        description: 'Fork Sync Test Mode'\n        type: boolean\n        default: false\n\njobs:\n  sync_latest_from_upstream:\n    runs-on: ubuntu-latest\n    name: Sync latest commits from upstream repo\n\n    steps:\n    # REQUIRED step\n    # Step 1: run a standard checkout action, provided by github\n    - name: Checkout target repo\n      uses: actions/checkout@v3\n      with:\n        # optional: set the branch to checkout,\n        # sync action checks out your 'target_sync_branch' anyway\n        ref:  my-branch\n        # REQUIRED if your upstream repo is private (see wiki)\n        persist-credentials: false\n\n    # REQUIRED step\n    # Step 2: run the sync action\n    - name: Sync upstream changes\n      id: sync\n      uses: aormsby/Fork-Sync-With-Upstream-action@v3.4.1\n      with:\n        target_sync_branch: my-branch\n        # REQUIRED 'target_repo_token' exactly like this!\n        target_repo_token: ${{ secrets.GITHUB_TOKEN }}\n        upstream_sync_branch: main\n        upstream_sync_repo: aormsby/Fork-Sync-With-Upstream-action\n        upstream_repo_access_token: ${{ secrets.UPSTREAM_REPO_SECRET }}\n\n        # Set test_mode true during manual dispatch to run tests instead of the true action!!\n        test_mode: ${{ inputs.sync_test_mode }}\n      \n    # Step 3: Display a sample message based on the sync output var 'has_new_commits'\n    - name: New commits found\n      if: steps.sync.outputs.has_new_commits == 'true'\n      run: echo \"New commits were found to sync.\"\n    \n    - name: No new commits\n      if: steps.sync.outputs.has_new_commits == 'false'\n      run: echo \"There were no new commits.\"\n      \n    - name: Show value of 'has_new_commits'\n      run: echo ${{ steps.sync.outputs.has_new_commits }}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faormsby%2FFork-Sync-With-Upstream-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faormsby%2FFork-Sync-With-Upstream-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faormsby%2FFork-Sync-With-Upstream-action/lists"}