diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index deda6a2..1f64147 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,7 @@ ## Types of PR - [ ] Chore +- [ ] Release - [ ] New Feature - [ ] Bug Fixing - [ ] Refactor @@ -14,7 +15,5 @@ ## Checklist -- [ ] README.md (optional) -- [ ] wiki (optional) -- [ ] manifest.json (extension) -- [ ] SECURITY.md (extension) +- [ ] A +- [ ] B diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..e54b1c0 --- /dev/null +++ b/.zshrc @@ -0,0 +1,45 @@ +# git +alias gc="git commit" +alias gs="git status" +alias gS="git switch" +alias gP="git push" +alias gp="git pull" +alias gf="git fetch" +alias gco="git checkout" +alias gm="git merge" +alias gt="git tag" +alias gl="git log" +alias gw="git worktree" + +# git flow +alias gflw="git flow" +alias gflwi="git flow init" +alias gflwfs="git flow feature start" +alias gflwrs="git flow release start" +alias gflwhs="git flow hotfix start" +alias gflwbs="git flow bugfix start" + +# integrate with github cli to create pr +function gflwpr() { + case "$1" in + feature) + gh pr create --base develop + ;; + bugfix) + gh pr create --base develop + ;; + refactor) + gh pr create --base develop + ;; + release) + gh pr create --base main + ;; + hotfix) + gh pr create --base main + ;; + *) + echo "Usage: gflwpr {feature|release|refactor|hotfix|bugfix}" + ;; + esac +} + diff --git a/README.md b/README.md new file mode 100644 index 0000000..bb7ea68 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# Git-flow with github actions CI/CD + +### What's the difference + +The `git-flow` workflow is made for _personal-usage_, hence adding CI/CD transform the same branching workflow convention to match with standard Pull Request workflows using github cli. + +--- + +### Installation + +##### git-flow + +Windows - [Git for Windows](https://gitforwindows.org/) +MacOS - `brew install git-flow` +Linux - e.g. `sudo apt install git-flow` (based on your package manager) + +##### github cli + +Windows - e.g. `winget install GitHub.CLI` (based on your package manager) +MacOS - `brew install gh` +Linux - e.g. `sudo apt install github-cli` (based on your package manager) + +--- + +### Setup + +1. Run `git flow init` in your repository and complete the setup +2. Run `gh auth login` and complete the auth +3. Modify/Append [.zshrc](./.zshrc) tailored to your setup (optional) + +--- + +### How to start using + +1. Run `git flow (branch) start (name_of_the_branch)` / `git checkout -b (name_of_the_branch)` (optional for refactor branch) +2. **DO NOT** complete with `git flow (branch) finish (name_of_the_branch)`, instead do `gh pr create --base (branch - follow git-flow convention)` +3. Follow the `gh cli` to complete the PR process +4. You should now see the branch getting _merged_ and _deleted_ + +--- + +### Reference + +- [git-flow official documentation](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) +- [github actions plan limits](https://docs.github.com/en/actions/reference/limits)