GitHub Action
Merge and Stop
v2.0.5
Latest version
This GitHub Action (written in JavaScript) allows you to leverage GitHub Actions to merge the current branch into another branch without committing and pushing. This is very useful when you want to run assertions assuming the pull-request was merged using the defined method.
Create a workflow .yml
file in your .github/workflows
directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.
All of these inputs are required. For more information on these inputs, see the Workflow syntax for GitHub Actions
method
: The merging method to use. Currently supports''
andsquash
. Optional. Default:''
reference
: The branch/commit reference to merge into the current branch. For example,origin/${{ github.head_ref }}
None.
Ideally, set this up as an initial job for your workflows. For example:
on: pull_request
name: Continuous Integration
jobs:
build:
name: Example
runs-on: ubuntu-latest
steps:
- name: Clone the repository
uses: actions/checkout@v2
with:
ref: ${{ github.base_ref }}
fetch-depth: 0
- name: Merge and stop
uses: zgosalvez/github-actions-merge-and-stop@v2
with:
method: squash
reference: origin/${{ github.base_ref }}
The scripts and documentation in this project are released under the MIT License