{"id":20696811,"url":"https://github.com/actionsdesk/cascading-downstream-merge","last_synced_at":"2025-04-22T20:43:59.042Z","repository":{"id":37082325,"uuid":"494602048","full_name":"ActionsDesk/cascading-downstream-merge","owner":"ActionsDesk","description":"A GitHub implementation of a Cascading Auto-Merge feature","archived":false,"fork":false,"pushed_at":"2025-04-17T14:52:59.000Z","size":3473,"stargazers_count":11,"open_issues_count":4,"forks_count":5,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-18T04:29:49.707Z","etag":null,"topics":["automerge"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ActionsDesk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-20T20:43:55.000Z","updated_at":"2025-04-17T14:53:02.000Z","dependencies_parsed_at":"2023-12-14T20:31:55.384Z","dependency_job_id":"18dbf934-a923-47f9-9910-ecee25b46084","html_url":"https://github.com/ActionsDesk/cascading-downstream-merge","commit_stats":{"total_commits":98,"total_committers":3,"mean_commits":"32.666666666666664","dds":0.653061224489796,"last_synced_commit":"a8e0331a8c15e5d35acee5d478f6abd1078cf841"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActionsDesk%2Fcascading-downstream-merge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActionsDesk%2Fcascading-downstream-merge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActionsDesk%2Fcascading-downstream-merge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActionsDesk%2Fcascading-downstream-merge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ActionsDesk","download_url":"https://codeload.github.com/ActionsDesk/cascading-downstream-merge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250321531,"owners_count":21411593,"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":["automerge"],"created_at":"2024-11-17T00:15:25.315Z","updated_at":"2025-04-22T20:43:59.035Z","avatar_url":"https://github.com/ActionsDesk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cascading Auto-Merge\n\nThis project is a GitHub implementation of a `Cascading Auto-Merge` feature\nsimilar to\n[Bitbuckets' Automatic branch merging](https://confluence.atlassian.com/bitbucketserver/automatic-branch-merging-776639993.html).\nIt auto-merges release branches based on\n[semantic versioning](https://semver.org/).\n\nThe **Cascading Auto Merge** feature is applicable per repository, it can be\nenabled on branch prefixes and supports semantic versioning.\n\n## Changelog\n\n### Version 3.0.0\n\nAs of version 3.0.0, the action has been updated to use Bitbucket's branch\nordering algorithm as described\n[here](https://confluence.atlassian.com/bitbucketserver/cascading-merge-776639993.html).\n\n## Use Case\n\nSuppose an organization has the following release branch structure in their\nRepository.\n\n| Branches             |\n| -------------------- |\n| main                 |\n| development          |\n| release/0.1          |\n| release/1.1-rc.1     |\n| release/1.1          |\n| release/1.2          |\n| release/2.0          |\n| release/2.0.1-alpha  |\n| release/2.0.1-beta   |\n| release/2.0.1-beta.1 |\n\nA developer makes a change to the `release/1.1` branch and issues a pull request\n(PR) against the `development` branch, requesting at least one approval. The\nfollowing should happen when the PR is approved:\n\n1. `release/1.1` is merged into `development`\n1. `release/1.1` is merged into all **subsequent** releases based on their\n   semantic version\n\nThis sample output should demonstrate the expected GitHub behaviour:\n\n![Example](./img/example.png)\n\nIn the original PR you will see comments for each subsequent cascading merge PR,\nincluding links to these PRs, providing a full audit trail of automated merges.\n\nBelow is a sample output of a test run.\n\n![Output](./img/output.png)\n\n## Supported Branch Versioning\n\nThe following will give some examples on the supported semantic versions\n\nReference: [Semantic Versioning](https://semver.org/)\n\n### Semantic Version Number - `MAJOR.MINOR.PATCH`\n\n- Increment the **MAJOR** version when you make incompatible API changes\n- Increment the **MINOR** version when you add functionality in a backward\n  compatible manner\n- Increment the **PATCH** version when you make backward compatible bugfixes\n\n### Prerelease and Build Metadata\n\nThese are available as extensions to the `MAJOR.MINOR.PATCH` format.\n\n| Extensions | + Version |\n| ---------- | --------- |\n| alpha      | alpha.1   |\n| beta       | beta.1    |\n| rc         | rc.1      |\n\n### Version Syntax\n\n`\u003cprefix\u003e/\u003cMAJOR\u003e.\u003cMINOR\u003e.\u003cPATCH\u003e-[ alpha | beta | rc ].\u003cversion\u003e`\n\n\u003e The `prefix` is specific to our implementation\n\n### Examples\n\nIn these examples we omit the prefix. In each table, rows are ordered from\noldest to newest.\n\n#### Standard Versioning\n\n| Example |\n| ------- |\n| 1.1.0   |\n| 1.1.2   |\n| 1.2.0   |\n| 1.2.1   |\n| 1.3.0   |\n| 2.0.0   |\n\n#### Prerelease Versioning\n\n| Example       |\n| ------------- |\n| 1.0.0-alpha   |\n| 1.0.0-alpha.1 |\n| 1.0.0-beta    |\n| 1.0.0-beta.2  |\n| 1.0.0-beta.11 |\n| 1.0.0-rc.1    |\n| 1.0.0         |\n\n### Branch Naming Examples\n\n- `release/1.1.0`\n- `release/1.2.0-beta`\n- `feature/1.1.0-alpha.1`\n\n## Action Configuration\n\n### Allow GitHub Actions to Create Pull Requests\n\nIn the admin permissions for the organization or repository enable the option to\n[allow GitHub Actions to create and approve pull requests](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests).\n\nThis is needed in order to allow the GitHub Action to create and open the PRs.\n\n### Disable the Automatic Branch Deletion\n\nThe action relies on the branch that opens the PR to remain in place so that the\nsubsequent merges can still occur. The option to\n[automatically delete head branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches)\nmust be deselected in order for the action to work properly.\n\n### Example Workflow\n\n```yaml\n---\nname: Automatic Branch Merging\n\non:\n  pull_request:\n    types:\n      - closed\n\npermissions:\n  contents: write\n  pull-requests: write\n  issues: write\n\njobs:\n  merge:\n    name: Cascading Auto Merge\n    runs-on: ubuntu-latest\n\n    if: |\n      github.event.pull_request.merged == true \u0026\u0026\n      startsWith(github.head_ref, 'release/')\n\n    steps:\n      - name: Automatic Merge\n        uses: ActionsDesk/cascading-downstream-merge@vX.Y.Z # Replace with the latest version\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          prefixes: release/\n          ref_branch: development\n```\n\n### Protected Branches\n\nThere are cases where you may want to use branch protection on branches where\nyou also need to use this action. In those cases you'll need to use an\nadditional secret named `MERGE_TOKEN` that has elevated access to the\nrepository. The pre-existing `GITHUB_TOKEN` provided by GitHub Actions will not\nbe able to bypass the branch protection.\n\nTherefore you'll need to create a\n[Machine User](https://docs.github.com/en/developers/overview/managing-deploy-keys#machine-users)\nwith Admin access or a\n[custom GitHub App](https://docs.github.com/en/developers/apps/building-github-apps/creating-a-github-app)\nwith the following permissions:\n\n- Repository Contents: Read \u0026 Write\n- Pull Requests: Read \u0026 Write\n\nEither of these can be used in the selected option to\n[allow specified actors to bypass required pull requests](https://github.blog/changelog/2021-11-19-allow-bypassing-required-pull-requests/).\n\n```yml\nname: Automatic Branch Merging\n\non:\n  pull_request:\n    types:\n      - closed\n\npermissions:\n  contents: write\n  pull-requests: write\n  issues: write\n\njobs:\n  merge:\n    name: Cascading Auto Merge\n    runs-on: ubuntu-latest\n\n    if: |\n      github.event.pull_request.merged == true \u0026\u0026\n      startsWith(github.head_ref, 'release/')\n\n    steps:\n      - name: Get GitHub App Token\n        id: token\n        uses: actions/create-github-app-token@v2\n        with:\n          app-id: ${{ secrets.CUSTOM_APP_ID }}\n          private-key: ${{ secrets.CUSTOM_APP_PEM_FILE }}\n          owner: ${{ github.repository_owner }}\n\n      - name: Automatic Merge\n        uses: ActionsDesk/cascading-downstream-merge@vX.Y.Z # Replace with the latest version\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          merge_token: ${{ steps.token.outputs.token }}\n          prefixes: release/\n          ref_branch: development\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factionsdesk%2Fcascading-downstream-merge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factionsdesk%2Fcascading-downstream-merge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factionsdesk%2Fcascading-downstream-merge/lists"}