0
votes

We have two workflow that trigger on push set up like this:

on:
  push:
    branches:
      - master

Inside of one workflow, it contains an action that push a bump version commit into master. Inside of the other, it validate if the commit message is a bump and deploy automatically.

Currently, when we push a commit to master, we can see the github action created a commit in master like this:

Automated Version Bump ci: version bump to v1.2.3

Where Automated Version Bump is the name of the GitHub action and ci: version bump to v1.2.3 is the commit message generated by the GitHub action

I was expecting the workflow to trigger again because of the automated commit.

Does that means Automated Commit does not trigger workflow hook?

Thank you!

1

1 Answers

1
votes

It seems this behaviour is a feature.

From the workflow events page:

An action in a workflow run can't trigger a new workflow run. For example, if an action 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.

So basically, events that originate from a workflow cannot trigger other workflows.


An alternative would be to use a scheduled workflow that checks every couple hours or so and does the validation.

on:
  schedule:
    - cron:  '0 0/2 * * *'