Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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`.
- Host: GitHub
- URL: https://github.com/raulanatol/only-merge-from-action
- Owner: raulanatol
- License: mit
- Created: 2020-10-12T16:04:05.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-13T10:28:38.000Z (about 4 years ago)
- Last Synced: 2024-09-26T00:13:12.551Z (about 2 months ago)
- Language: TypeScript
- Homepage:
- Size: 342 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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_requestjobs:
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
```