https://github.com/julbme/gh-action-merge-branch
GitHub action to merge commits to a branch
https://github.com/julbme/gh-action-merge-branch
Last synced: about 1 year ago
JSON representation
GitHub action to merge commits to a branch
- Host: GitHub
- URL: https://github.com/julbme/gh-action-merge-branch
- Owner: julbme
- License: mit
- Created: 2022-02-23T16:05:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-03T21:05:33.000Z (over 3 years ago)
- Last Synced: 2025-01-22T09:16:52.047Z (over 1 year ago)
- Language: Java
- Size: 625 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/julbme/gh-action-merge-branch/actions/workflows/maven-build.yml)
[](https://github.com/julbme/gh-action-merge-branch/actions/workflows/commitlint.yml)
[](https://sonarcloud.io/summary/new_code?id=julbme_gh-action-merge-branch)

# GitHub Action to merge to a branch
The GitHub Action for merging tag, branch or commit to a branch in the GitHub repository.
## Usage
### Example Workflow file
```yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Merge branch
uses: julbme/gh-action-merge-branch@v1
with:
from: ${{ github.ref }}
to: branch-name
message: Merge commit message
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
### Inputs
| Name | Type | Default | Description |
|-----------|--------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `from` | string | `github.sha` | The reference from which to merge the branch - could be a branch, a tag, a ref or a specific SHA. By default, it takes the commit that triggered the workflow. |
| `to` | string | `Not set` | Name of the target branch. **Required** |
| `message` | string | ` ` | The message associated to the merge. If not set, will be the default GitHub message. |
### Outputs
| Name | Type | Description |
|-------|--------|-------------------------------------------------------------------------------------|
| `sha` | string | The merge commit SHA, or the target branch latest commit SHA if no merge is needed. |
## Contributing
This project is totally open source and contributors are welcome.