简体   繁体   中英

Why does my GitHub action not run on branch push, despite push on that branch and workflow triggers

I've been getting started with GitHub Actions (and git/bash). I have tried (one after another) a workflow with the following triggers:

on:
  push:
    paths:
      - contribute-pages/**
      - documentation-pages/**
      - general-pages/**
      - general-strings/**
on:
  push:
    branches:
      - translation-files

However, when the Weblate bot pushes changes to that very folder and branch ( example ) the action does not kick in. Why might that be the case?

I should note that the Workflow file lives in the 'main' branch, not the 'translation-files' branch it should be reacting to. But since the trigger mentions that translation-files branch I would expect that not to be a problem.

Ah, and the action does run when initiated manually:)

Many thanks to all in advance!

It can't work that way. You need to have workflow file on translation-files branch as well.

To answer your questions from comments:

Do you know why this is not possible?

Is it not possible to have a workflow in another branch than main/master?

You can have workflow in any branch. Your branching strategy is a bit out of the ordinary. You have translation-files branch which seems to be long lived branch that doesn't get updated by master, so it doesn't have your workflow and for that reason doesn't get triggered.

Github actions is obviously built around Github flow, and for that kind a flow it makes sense to have workflows on each branch. If you still don't understand why it is designed that way or don't know what Github flow is, you can start here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM