Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 2
Message 1 of 5

Update documentation on Github Actions page

There are some information which are not valid for time being therefore it would be nice to have updated documentation. I have tried to use paths-ignore keyword, yet it did not work and also Github did not make auto suggestion for that keyword. I thought that documentation  is outdated hence I wanted to open the situation here.

 

Here is the link where documentation explains how to ignore changes on given part in order to do not trigger CI.

 

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-...

 

 

4 Replies
Highlighted
GitHub Partner
Message 2 of 5

Re: Update documentation on Github Actions page

Hi mrturkmen06,

 

I tested the paths-ignore syntax, and it can work as expectation, when the changed file name match the pattern in paths-ignore, the workflow will not be triggered.
Can you share the YAML file of your workflow that has set the paths-ignore syntax, so that we can analyze the root cause?
In addition, there are several suggestions and notes as reference:
1) You only can use one of paths and paths-ignore for a single event.

Invalid_Workflow_File.PNG

2) If you want set some paths filters that can include some paths and exclude some paths for a single event, you can use the ! character in paths syntax.

example.PNG

3) A matching negative pattern (prefixed with !) after a positive match will exclude the path, and a matching positive pattern after a negative match will include the path again.

Copilot Lvl 2
Message 3 of 5

Re: Update documentation on Github Actions page

Hi, BrightRan

 

https://github.com/nakamasato/github-actions-practice/blob/master/.github/workflows/auto-approve.yml

 

I want to trigger the workflow there's no change outside the specified directory (`automatic-approval` in this case). More specifically what i want to implement is the following:

 

- If there's changes under automatic-approval and there's changes under other directory too, not trigger.

- If there's changes under automatic-approval and there's NO changes under other directory too, trigger.

- If there's NO changes under automatic-approval and there's changes under other directory too, not trigger.

- If there's changes under automatic-approval and there's NO changes under other directory too, not trigger.

 

I tried to use path-ignore and negative expression. 

github-actions.png

 

 

 

 

 

 

 

But it didn't work as expected and the workflow is triggered by any pull request... Could you give me any advice?

 

 

GitHub Partner
Message 4 of 5

Re: Update documentation on Github Actions page

It is impossible to implement the your request, once there are changes under "automatic-approval", the workflow will always be triggered, it does not care about whether there are changes outside "automatic-approval" or not.

Copilot Lvl 2
Message 5 of 5

Re: Update documentation on Github Actions page

Okay, thank you for your reply!