This work has been inspired by pascalgn/automerge-action, which I used for a long time before taking over and writing this that better fits my needs.
This action (by design choice, mostly due to portability) does not rely on GitHub inputs, but uses environment variables.
GITHUB_TOKEN
: Mandatory, GitHub authentication token. Usually set to${{ secrets.GITHUB_TOKEN }}
.MERGE_FORKS
: Whether pull requests coming from repositories other thanGITHUB_REPOSITORY
should be considered for an automatic merge. Defaults tofalse
. Anything buttrue
(ignoring case) is interpreted asfalse
.MERGE_LABELS
: List of comma separated labels that must be present on a pull request for Yaagha to run the merge operation, defaults toautomerge
.BLOCK_LABELS
: List of comma separated labels that, if present, prevents automatic merging. Default empty. Block labels take priority over merge labels.MERGE_METHOD
: How to merge, betweenmerge
,rebase
, andsquash
. Defaults tomerge
.FALLBACK_TO_MERGE
: In case theMERGE_METHOD
is notmerge
, whether to perform a merge anyway if the pull request ismergeable
but notrebaseable
AUTO_UPDATE
: Whether pull requests coming from this repository should get updated before merge. Defaults totrue
. Anything buttrue
(ignoring case) is interpreted asfalse
.MERGE_WHEN_BEHIND
: ifAUTO_UPDATE
is disabled, Whether to merge pull requests that are in mergeable statebehind
. Defaults tofalse
Anything buttrue
(ignoring case) is interpreted asfalse
.CLOSE_ON_CONFLICT
: Closes the pull request if it can't get updated (mergeable statedirty
). Defaults tofalse
. Anything buttrue
(ignoring case) is interpreted asfalse
.DELETE_BRANCH_ON_CLOSE
: if the pull request does not come from a fork and bothAUTO_UPDATE
andCLOSE_ON_CONFLICT
are set, this flag determines whether the head branch should get deleted. Defaults tofalse
. Anything buttrue
(ignoring case) is interpreted asfalse
. The same behavior in case of successful merge can be achieved by configuring "Automatically delete head branches" in the repository's options.GIT_USER_NAME
: Name of the committer, to be used in case of rebase update. Defaults toyaagha [bot]
GIT_USER_EMAIL
: Email of the committer, to be used in case of rebase update. Defaults toyaagha@automerge.bot
These options are available, but the average user will probably never need to mess with them.
GITHUB_API_URL
: API endpoint. Defaults tohttps://api.github.com
GITHUB_REPOSITORY
: Repository where this action is being run. Automatically populated by GitHub Actions.GITHUB_SERVER_URL
: GitHub server URL. Defaults tohttps://github.com
GITHUB_WORKSPACE
: Internal work directory. Automatically populated by GitHub Actions.
Yaagha uses yaagha to keep itself up to date. Just look at this file for a working configuration.