Developing workflows in branches
Starting in a greenfield repository, it is best to create your workflows on the main
branch. However, if you must create the workflow in an active repository that developers are working in and you don’t want to get in their way, then it is possible to write workflows in a branch and merge them back to the main branch using a pull request.
However, some triggers might not work as expected. If you want to run your workflow manually using the workflow_dispatch
trigger, your first action must be to merge the workflow with the trigger back to main
or use the API to trigger the workflow. After that, you can author the workflow in a branch and select the branch when triggering the workflow through the UI.
If your workflow needs webhook triggers, such as push
, pull_request
, or pull_request_target
, it might be necessary to create the workflow in a fork of the repository, depending on what you plan on doing with the triggers. This way, you can test...