PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, October 9, 2022

[FIXED] How to run GitHub Actions workflow only if the pushed files are in a specific folder

 October 09, 2022     continuous-integration, github, github-actions     No comments   

Issue

I have a folder structure that looks something like this.

- folder1
  - file1
  - *other files*
- folder2
  - file1
  - *other files*
- .gitignore
- package.json
- *other files*

I want to run my GitHub Actions workflow on push, only if any of the changed/pushed files are located in the folder1 directory/folder.


Solution

The normal syntax involves a path filter

on:
  push:
    paths:
      - folder1/**

If that is not enough, you also have the GitHub Action Path Filter.



Answered By - VonC
Answer Checked By - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing