TIL: Github does not allow workflows to trigger another workflow

TIL: Github does not allow workflows to trigger another workflow
Photo by Roman Synkevych / Unsplash

As heading gives the main idea, GitHub does not allow us to use workflow to trigger another workflow but the main reason behind the scene is not completely same.

The main reason is, you are using GITHUB_TOKEN for authentication when you don't explicitly define Personal Access Token (PAT) for the workflow.

As mentioned in depth of the documentation;

When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN, with the exception of workflow_dispatch and repository_dispatch, will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs. For example, if a workflow run pushes code using the repository's GITHUB_TOKEN, a new workflow will not run even when the repository contains a workflow configured to run when push events occur.
Automatic token authentication - GitHub Docs
GitHub provides a token that you can use to authenticate on behalf of GitHub Actions.