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 a new file is pushed

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

Issue

Let's say that I have an action like such:

    name: Another_Action
    on:
      push:
        - ...
      pull_request:
        - ...

And I want it so that it only runs when a new file is committed.

I've got some options from the autocomplete:

Option Would help?
branches Nope
branches-ignore Nope
tags ???
tags-ignore ???
paths Maybe
paths-ignore Maybe
types ???

Using paths-ignore and listing all files and directories we already know of won't work since I want it automated and the directories won't stay the same forever.

I'm thinking of using paths for this since I already have used it in the past...

But I don't know how to use it in this context.


Solution

There is no such option. You can only abort the pipeline early by checking for new files after the checkout step has run



Answered By - jessehouwing
Answer Checked By - Marie Seifert (PHPFixing Admin)
  • 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