Push doesn't trigger workflow action in an open PR

Hi guys,

I’m trying to get accustomed to GitHub actions. Probably I’m missing something obvious. I have two workflows, one called CI and the other called Clang-Format, configured to trigger as:

name: CI
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
name: Clang-Format

on: push

Now, in an open PR (to master), when I push any changes to the relevant branch, both CI and Clang-Format triggers. Former due to pull_request and the latter due to push. So far so good.

Then, the latter commits changes and pushes to the same branch (within the action). However, this latter push doesn’t trigger the CI (pull_request) but it triggers Travis which is also configured for pull request.

I have a very basic example here: https://github.com/amete/hello_world/pull/6

Why doesn’t the last commit/push trigger the CI/build (pull_request)? Any ideas?

Many thanks.

Best,
Serhan

Hi @amete,

Glad to see you in Github Community Forum!

This is by designed. The latter commit is pushed within an action. There is a limitation of workflow: An action in a workflow run can’t trigger a new workflow run

When you use GITHUB_TOKEN in your actions, all of the interactions with the repository are on behalf of the Github-actions bot. The operations act by Github-actions bot cannot trigger a new workflow run.
lattercommit

As an alternative, you can create a personal access token, and use it to create an encrypted secret, use the secret instead of GITHUB_TOKEN for the action. Please check similar ticket for the details.

Thanks

Thanks @weide-zhou, that’s really useful!