Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/raulanatol/only-merge-from-action

Github action to close a PR if the base branch is not the one specified in the `allowed-branch`.
https://github.com/raulanatol/only-merge-from-action

Last synced: about 1 month ago
JSON representation

Github action to close a PR if the base branch is not the one specified in the `allowed-branch`.

Awesome Lists containing this project

README

        


only-merge-from-action


Github action to close a PR if the base branch is not the one specified in the `allowed-branch`.

![message](./docs/message.png)

---

## Table of Contents

- [Inputs](#inputs)
- [`github-token`](#github-token)
- [`protected-branch`](#protected-branch)
- [`allowed-branch`](#allowed-branch)
- [Example of usage](#example-of-usage)
- [Example using a custom branches](#example-using-a-custom-branches)
- [Development](#development)
- [Close release](#close-release)
- [Documentation](#documentation)

## Inputs

### `github-token`

**Required** The github token to comment in the PR.

### `protected-branch`

The name of the protected branch

### `allowed-branch`

The name of the branch allowed to merge over the protected branch

## Example of usage

```yaml
uses: raulanatol/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```

## Example using a custom branches

**.github/workflows/main.yml**

```yaml
on: pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: raulanatol/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
protected-branch: production
allowed-branch: stage
```

## Development

### Close release

To close a release you only need to execute the makefile with `release_{major|minor|patch}`

Example:

```shell script
make release_minor
```

### Documentation

To generate the documentation you only need to execute the makefile with `docs`.

> Using [doctoc](https://github.com/thlorenz/doctoc)

```shell script
make docs
```