Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 1 of 5

Github Actions workflow on deployment

Hi all,

 

So I created a deployment workflow in Github Actions which starts on a deployment event, and triggers a new deploy. After the actual deployment, it creates a succes deployment status so that you can see the deployment url in your pull request.

 

Now this workflow is triggered perfectly when I use postman for instance to create the new deployment for a branch. So I know that the workflow and actions are working.

 

So I wanted to go 1 step further with my automatisation and introduced a second worfklow which is triggered after a check suite is completed (coming from our ci server). This check suite then creates a new deployment for that branch. This is working as well, because I can see the `pending deployment` on the pull request.

 

But then the first workflow is never triggered to do the actual deploy. Again, this works perfect if I create a deployment from postman.

 

The only difference between creating a deployment from postman and from a github action is the user who created the deployment. In postman I used a personal access token and in the Github Action I used the token provided by the action which represents the Github Action Bot.

 

Could it be that it is not pissible to trigger workflow from within another workflow?

 

Kind regards,

Joris.

4 Replies
Copilot Lvl 2
Message 2 of 5

Re: Github Actions workflow on deployment

Hi, Joris,

 

You're correct — from Workflow limitations:

 

An action can't trigger other workflows. For example, a push, deployment, or any task performed within an action with the provided GITHUB_TOKEN will not trigger a workflow listening on push, deploy, or any other supported action triggers.

 

Electron Engineer @ GitHub
Highlighted
Copilot Lvl 3
Message 3 of 5

Re: Github Actions workflow on deployment

Is it also not possible anymore to call the Checks Api from an action? In theory you could call the api and create a completed check right?

Copilot Lvl 2
Message 4 of 5

Re: Github Actions workflow on deployment

 After the actual deployment, it creates a success deployment status so that you can see the deployment url in your pull request.

 

How do we create a deployment status from inside our Github action?

Copilot Lvl 2
Message 5 of 5

Re: Github Actions workflow on deployment

In our project [1], we're trying to achieve the desired effect (triggering one workflow from another workflow) by creating the deployment using a personal access token, not the GITHUB_TOKEN provided by the environment [2]. The deployment is created as expected, and the GitHub UI confirms that our bot account was responsible, e.g.

wpt-preview-20350 — f477bd9b Deployed 31 minutes ago by wpt-pr-bot

But still, our workflow configured with "on: deployment" [3] is never executed. Can anyone at GitHub explain why this is the case?

[1] https://github.com/web-platform-tests/wpt
[2] https://github.com/web-platform-tests/wpt/blob/e38cfc949a8c8d1709e60ff8d5b44a0f9aedea98/.github/work...
[3] https://github.com/web-platform-tests/wpt/blob/e38cfc949a8c8d1709e60ff8d5b44a0f9aedea98/.github/work...