Github workflow event trigger synchronize not working?

Viewed 916

I have the following github workflow definition:

name: Build

on:
    pull_request:
        types: [ opened, edited, synchronize ]
        paths-ignore:
            - '**.md'
    push:
        branches: 
            - main
jobs:
    get-job:
        name: My job
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2

            - name: Say hello
              run: |
                    echo Hello!
  1. I create a pull request from the head-branch to base-branch. The workflow is triggered as expected.
  2. I commit and push a change to head-branch. The workflow is triggered as expected.
  3. I commit and push another change to head-branch. The workflow is NOT triggered as expected:

Synchronize not working

I have read the documentation and other sources, all of which describe the synchronize type as the type I need to use to ensure every new change in the PR triggers the workflow. Why does it work intermitently?

1 Answers

In my case this was being caused due to the fact that the head branch and base branch of my PR had conflicts. I figured this out thanks to this other answer and no thanks due to github actions output which gave no clue of this whatsoever.

Related