Pull request and merge actions in CI/CD
In my opinion there should be a staging branch , which holds the production candidate code.And instead of a Test env , have a staging env which will be complete replica of Prod env. In the Staging env the QA can perform their testing and other checks.


Dev env =  only for developer.
Stage env =  Replica of Prod and holds production candidate build/code , where QA can perform their testing and simulate Prod.

Having a Staging branch has its benefit as you can have code which will merge to master and deploy to prod , and the developer can experiment/work on develop branch without worrying of any accidental merge to master directly.

Once someone completes a feature or fixes a bug/error or implementation is done and testing needs to be performed.

same as above.

Once the code has been passes the test's and QA verified on staging env and No new   feature are to be added to Prod , it can be merged to master.

No new feature are to be added to Prod , QA passed and test cases passed, it can be merged to master

That's where the Staging branch will help , as even if code fails on stage as it is supposed to be complete replica of prod env. we can revert or commit the fix again without worrying of our master branch.