From f85928588466f7584073e862371ff4a158bbf37a Mon Sep 17 00:00:00 2001 From: Milad Nekofar Date: Sun, 28 Jan 2024 08:46:09 +0330 Subject: [PATCH] ci: add new git flow workflow for handling pull requests Signed-off-by: Milad Nekofar --- .github/workflows/git-flow.yml | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/git-flow.yml diff --git a/.github/workflows/git-flow.yml b/.github/workflows/git-flow.yml new file mode 100644 index 00000000..85f42f75 --- /dev/null +++ b/.github/workflows/git-flow.yml @@ -0,0 +1,44 @@ +# Name of the workflow +name: Git Flow + +# Defines the event that triggers the workflow +on: + push: + branches: + - 'feature/*' # Trigger for pushes to feature branches + - 'bugfix/*' # Trigger for pushes to bugfix branches + - 'release/*' # Trigger for pushes to release branches + - 'hotfix/*' # Trigger for pushes to hotfix branches + +# Jobs are a set of steps that execute on the same runner +jobs: + create-pull-request: + # Specifies the runner environment, using the latest Ubuntu + runs-on: ubuntu-latest + name: Create Pull Request + permissions: write-all + + # Steps are individual tasks that run commands in a job + steps: + # Checks out the repository code under $GITHUB_WORKSPACE, so the job can access it + - name: Checkout Repository Code + uses: actions/checkout@v4.1.1 + + # This step uses the Git Flow Action to create PRs based on branch types + - name: Execute Git Flow Action + uses: nekofar/git-flow-action@develop # Specifies the Git Flow Action to use and the branch + with: + # The GitHub Token for authentication with GitHub API + github-token: ${{ secrets.GITHUB_TOKEN }} + # The branch to target for release and hotfix PRs + master-branch: 'master' + # The branch to target for feature and bugfix PRs + develop-branch: 'develop' + # Prefix for feature branches + feature-prefix: 'feature/' + # Prefix for bugfix branches + bugfix-prefix: 'bugfix/' + # Prefix for release branches + release-prefix: 'release/' + # Prefix for hotfix branches + hotfix-prefix: 'hotfix/'