action is not trigged by file change

in the .github/workflows/runner.yaml

on:
  push:
    branches:
      - master
    paths:
      - 'runner/**'
      - '.github/workflows/runner.yaml'
  pull_request:
    branches:
      - master
    paths:
      - 'runner/**'
      - '.github/workflows/runner.yaml'

I change the .github/workflows/runner.yaml in the PR and action is not triggered
Without “paths:” the workflow runs but I do not wont it to be triggered on every PR.
Could you please tell me whats is wrong?

@iivvaall ,

I change the .github/workflows/runner.yaml in the PR and action is not triggered

From which branch the PR is merging? And into which branch the PR is merging?
In which branch did you change the " .github/workflows/runner.yaml" file?

According to the configurations of the triggers in your workflow, the workflow can be triggered in the following situations:

1) Directly push commits to the master branch, and at least one modified file in the commits can match the patterns (’ runner/**’ or ’ .github/workflows/runner.yaml’) of the paths filter. In this situation, the workflow YAML file must have been existing in the master branch, and the workflow is triggered by the Push event.

2) After pushing some commits in a branch (not the master branch, suppose it’s named " develop"), when creating and opening a PR to merge the commits from the develop branch into the master branch, at least one modified file in the commits can match the patterns (’ runner/**’ or ’ .github/workflows/runner.yaml’) of the paths filter. In this situation, the workflow YAML file must have been existing in the develop branch, and the workflow is triggered by the Pull Request event ( Activity type: opened ).

3) After opening the PR (the PR is " Open" status), when you push some commits to the develop branch, at least one modified file in the commits can match the patterns (’ runner/**’ or ’ .github/workflows/runner.yaml’) of the paths filter. In this situation, the workflow YAML file must be existing in the develop branch, and the workflow is triggered by the Pull Request event ( Activity type: synchronize ).

4) If you close the PR without merged (the PR is " Closed" status, not " Merged" status), then reopen this PR. In this situation, the workflow YAML file must be existing in the develop branch, and the workflow is triggered by the Pull Request event ( Activity type: reopened ).

So, please confirm whether it satisfies any of the above situations, when you change the " .github/workflows/runner.yaml" file.

In addition, if you run a workflow to modify and push files with using the GITHUB_TOKEN to authenticate, events triggered by the GITHUB_TOKEN will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs (see here).

@brightran wrote:

@iivvaall ,

I change the .github/workflows/runner.yaml in the PR and action is not triggered

From which branch the PR is merging? And into which branch the PR is merging?
In which branch did you change the " .github/workflows/runner.yaml" file?

 

3) After opening the PR (the PR is " Open" status), when you push some commits to the develop branch, at least one modified file in the commits can match the patterns (’ runner/**’ or ’ .github/workflows/runner.yaml’) of the paths filter. In this situation, the workflow YAML file must be existing in the develop branch, and the workflow is triggered by the Pull Request event ( Activity type: synchronize ).

 

Situation number 3. I am just starting using the github actions.

So I created new branch, added ./.github/workflows/runner.yaml, created PR and started pushing commits.

I tried to reproduce this situation in public repository (https://github.com/iivvaall/actions_test) and every thing just works. 

I double checked the path. They are OK.

What else cound influent the build? Any idea?

@iivvaall ,

I tested on my private and public repositories with the same workflow configurations as you posed, and I also did not reproduce the problem you reported, everything works fine as expected. This may be a temporary problem.

Please try again in your repository to see if the problem has gone on your side.

If the problem still exists, please feel free to tell me, and I will help you report this question to the appropriate engineering team for further investigation and evaluation.

◆ If your repository which has the problem is private, please share the repository’s name (e.g. myOrg/myRepo ) with us.

◆ If your repository which has the problem is public, please share the repository’s link with us.

I have just tested the workflow. It runs. It seems to be a temporary problem. Thank you!