Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/semestry/git-flow-action
The Git Flow Action is a GitHub Action that assists with the Git Flow branching model.
https://github.com/semestry/git-flow-action
actions git-flow github github-actions
Last synced: 6 days ago
JSON representation
The Git Flow Action is a GitHub Action that assists with the Git Flow branching model.
- Host: GitHub
- URL: https://github.com/semestry/git-flow-action
- Owner: semestry
- License: mit
- Created: 2021-11-15T10:58:01.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-08T06:19:11.000Z (about 1 month ago)
- Last Synced: 2024-11-08T00:48:42.638Z (8 days ago)
- Topics: actions, git-flow, github, github-actions
- Language: JavaScript
- Homepage:
- Size: 2.69 MB
- Stars: 2
- Watchers: 8
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Git Flow Action
The Git Flow Action is a GitHub Action that assists with the Git Flow branching model.
It's feature are:- **Comment when a pull request has a head branch name that doesn't have the feature branch or hotfix branch prefix**
- **Comment when a feature pull request doesn't target a development branch or another feature branch**
Because pull requests for feature branches should never target a main branch.
- **Comment when a hotfix pull request doesn't target a development branch or main branch**
Because pull requests for hotfix branches should never target other branches than these.- **Convert pull requests for cascading feature branches to draft automatically**
This prevents them from being merged accidentally into the base feature branch.## Usage
Create a personal access token with the `repo` permission and store it in a repository or organization level secret called `GIT_FLOW_ACTION_PAT`.
You can then create the following workflow file in your repository.`.github/workflows/check-pr.yml`:
```yaml
name: Check PRon:
# WARNING: Make sure to never check out, build or run untrusted code with the 'pull_request_target' event.
# See: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#pull_request_target
pull_request_target:
types: [opened, edited]jobs:
check-branches:
name: Check base branch and branch name
runs-on: ubuntu-latest
steps:
- uses: semestry/git-flow-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GIT_FLOW_ACTION_PAT }}
```## Configuration options
You can override configuration options using in the workflow file. For example:
```yaml
- uses: semestry/git-flow-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GIT_FLOW_ACTION_PAT }}
with:
feature_branch_prefix: 'feat/'
```| Option | Description |
|-----------------------------------|-------------------------------------------------------------------------------------------|
| `main_branch_pattern` | Regex for matching main branches. Default: `^(main|master)$` |
| `development_branch_pattern` | Regex for matching development branches. Default: `^(dev|develop|development)$` |
| `semestry_staging_branch_pattern` | Regex for matching development branches. Default: `^(X.Y-staging|X.Y.Z-staging)$` |
| `semestry_testing_branch_pattern` | Regex for matching development branches. Default: `^(X.Y-test|X.Y.Z-test)$` |
| `feature_branch_prefix` | Feature branch prefix. Default: `feature/` |
| `hotfix_branch_prefix` | Hotfix branch prefix. Default: `hotfix/` |
| `fix_branch_prefix` | Fix branch prefix. Default `fix/` |
| `staging_branch_prefix` | Staging branch prefix. Default `staging/` |