{"id":15286416,"url":"https://github.com/madladsquad/check-for-synced-branches-action","last_synced_at":"2026-03-04T05:31:20.282Z","repository":{"id":61255981,"uuid":"485737054","full_name":"MadLadSquad/check-for-synced-branches-action","owner":"MadLadSquad","description":"An action to check if 2 branches are synced and output their differences if any","archived":false,"fork":false,"pushed_at":"2025-03-13T22:14:33.000Z","size":32,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T01:51:20.625Z","etag":null,"topics":["action","git","github-actions","sync","yaml"],"latest_commit_sha":null,"homepage":"https://madladsquad.com/","language":null,"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/MadLadSquad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yaml","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,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"ko_fi":"madladsquad"}},"created_at":"2022-04-26T10:25:34.000Z","updated_at":"2025-04-01T16:33:58.000Z","dependencies_parsed_at":"2025-06-11T12:04:58.781Z","dependency_job_id":null,"html_url":"https://github.com/MadLadSquad/check-for-synced-branches-action","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MadLadSquad%2Fcheck-for-synced-branches-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MadLadSquad%2Fcheck-for-synced-branches-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MadLadSquad%2Fcheck-for-synced-branches-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MadLadSquad%2Fcheck-for-synced-branches-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MadLadSquad","download_url":"https://codeload.github.com/MadLadSquad/check-for-synced-branches-action/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MadLadSquad%2Fcheck-for-synced-branches-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259262607,"owners_count":22830560,"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":["action","git","github-actions","sync","yaml"],"created_at":"2024-09-30T15:13:55.746Z","updated_at":"2026-03-04T05:31:20.241Z","avatar_url":"https://github.com/MadLadSquad.png","language":null,"funding_links":["https://ko-fi.com/madladsquad"],"categories":[],"sub_categories":[],"readme":"# Check for synced branches action\n[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)\n[![trello](https://img.shields.io/badge/Trello-UDE-blue])](https://trello.com/b/HmfuRY2K/untitleddesktop)\n[![Discord](https://img.shields.io/discord/717037253292982315.svg?label=\u0026logo=discord\u0026logoColor=ffffff\u0026color=7389D8\u0026labelColor=6A7EC2)](https://discord.gg/4wgH8ZE)\n\nAn action to check if 2 branches are synced and output their differences if any\n\n## How to\nThe action can be called with\n```yaml\n- name: Check for synced branches action\n  uses: MadLadSquad/check-for-synced-branches-action@v1.0.0.3\n  with:\n    upstream-url: \"https://github.com/foo/foo\"\n    first-branch: master\n    second-branch: development\n```\n\n### Setup\nBefore we begin Github Actions pull without any commit history, lfs objects, submodules and such, which might be useful to you. The important thing is that this action cannot run without them as it will report false issues. In order to allow this you need to modify your checkout action to look like this\n```yaml\n- name: checking out code\n  uses: actions/checkout@v3\n  with:\n    ref: master\n    token: ${{ secrets.GITHUB_TOKEN }}\n    lfs: true\n    submodules: true\n    clean: false\n    fetch-depth: 0\n```\nto briefly explain if you don't know what any of this does:\n1. The `ref` field specifies the current branch to check out\n1. The `token` field is the toke with which github gains access to the repo, this token is predefined so you can leave the setting as is\n1. The `lfs` field enables [Git LFS](https://git-lfs.github.com/)\n1. The `submodules` field checks out the [submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) in the repository if any\n1. The `clean` field makes github not run `git clean -ffdx \u0026\u0026 git reset --hard HEAD`\n1. The `fetch-depth` fields specifies how much of the commit history to download, at default it's set to `1` but when set to `0` it downloads the whole history instead of just 1 commit\n\nOnce you have all this done you can move to the next step!\n\n### Inputs\nThe fields `first-branch` and `second-branch` are required because they store the names for the branches to compare.\n\nThe `upstream-url` field should contain the URL to a repository on github or anywhere else. If the field is not specified the action uses the `origin` remote\n\nAn additional field is the `both-upstream` bool, which when set to true will set all the remotes to the `upstream` remote added by specifying the `upstream-url` field\n\n### Outputs\nThe action outputs the `ahead` and `behind` integers, which can be used in your action if statements to enable and disable event such as creating an issue or pull request. Here is an example of an action that creates an issue when the `origin/master` branch is behind `upstream/master`\n```yaml\nname: Create automatic issue\non:\n  schedule:\n    - cron:  \"0 0 * * *\"\njobs:\n  Update-Fork:\n    runs-on: ubuntu-latest\n    steps:\n      - name: checking out code\n        uses: actions/checkout@v3\n        with:\n          ref: master\n          token: ${{ secrets.GITHUB_TOKEN }}\n          lfs: true\n          submodules: true\n          clean: false\n          fetch-depth: 0\n      - name: Extract commit data\n        uses: rlespinasse/git-commit-data-action@v1.x\n      - name: Check for synced branches action\n        id: check\n        uses: MadLadSquad/check-for-synced-branches-action@master\n        with:\n          upstream-url: \"https://github.com/kcat/openal-soft\"\n          first-branch: master\n          second-branch: master\n      - name: Issue\n        if: steps.check.outputs.behind \u003e 0\n        uses: JasonEtco/create-an-issue@v2 # Creates an issue\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          filename: .github/auto-issue-template.md\n          update_existing: true\n          search_existing: all\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadladsquad%2Fcheck-for-synced-branches-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadladsquad%2Fcheck-for-synced-branches-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadladsquad%2Fcheck-for-synced-branches-action/lists"}