Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 3

Trigger default branch workflow on fast forward merge push.

Solved! Go to Solution.

Hi! New to github actions and trying to set things up.

I spent a good amount of time in github actions docs but I have difficulties to express my problem. Therefore I may have missed the relevant part...

Anyway, I use the following workflow :

$ git checkout master # here is my default branch
$ git checkout develop # here is my development/unstable branch
$ # make some changes
$ git add ...
$ git commit ...
$ # repeat while new feature development is finished ...
$ git push # optionally push to origin/develop branch -> triggers workflow -> passed -> all OK
$ git checkout master
$ git merge --ff-only develop
$ git push # push to origin/master -> triggers workflow on develop branch instead of master =(

With the following configuration (rust specific):

name: Rust

on: [push]

jobs:
    build:

        runs-on: ubuntu-latest

        steps:
        - uses: actions/checkout@v2
        - name: Build
          run: cargo build --verbose
        - name: Run tests
          run: cargo test --verbose

Pushing the master branch with only a fast forward merge does not trigger a build on master branch but on the develop branch. Is it possible to trigger default branch build (here master) when pushing only a fast-forward merge to origin ?

 

Thanks for your help.

- logan

2 Replies
Highlighted
Solution
GitHub Partner
Message 2 of 3

Re: Trigger default branch workflow on fast forward merge push.

Sorry for letting you suffer this issue. This is an known issue for fast-forward merge. Github Team is tracking on it. 

Currently, I would not encourage you to use fast forward merge when push to master.  

Highlighted
Copilot Lvl 2
Message 3 of 3

Re: Trigger default branch workflow on fast forward merge push.

Thanks for your answer!