Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 3

GitHub Actions Tips (particularly regarding filters)

Re-posting this from here, as I think maybe I posted in the wrong folder.

 

So I have a workflow defining some actions for a simple static site project I am working on, which runs some linting, builds the project and deploys to netlify. However I am having some issues:

 

  • A failed filter "Run on Master" seems to cancel another filter "Run on PR" which executes after the same action. Is there are good way to get if / else behaviour with filters? This is preventing me from having separate production / staging deployments.
  • Is there a way to "group" status checks on PRs? Currently each action appears individually on the PR, even if it is not a status check. They don't appear in the order they ran either, but alphabetically. The way I've set it up honestly isn't very meaningful at a glance on a PR, particularly for someone unfamiliar with the project, I imagine.
  • Are there any strategies that could reduce my build time? e.g. I am currently installing the npm dependencies on each run, and the gatsby .cache folder is not maintained in between each build. With equivalent systems that I have used in the past, e.g. circleci, I've come across strategies that worked quite well.

 

Thanks for anyone taking a look at this, much appreciated.

2 Replies
GitHub Staff
Message 2 of 3

Re: GitHub Actions Tips (particularly regarding filters)

Hi! I'll try to answer a couple of things.

 


A failed filter "Run on Master" seems to cancel another filter "Run on PR" which executes after the same action.

 

I don't have a lot of knowledge in this area but maybe you can create two workflow files, so they run independently and if a filter is not met in one, it doesn't stop anything in the other workflowfile.

 


Is there a way to "group" status checks on PRs? Currently each action appears individually on the PR, even if it is not a status check. They don't appear in the order they ran either, but alphabetically. The way I've set it up honestly isn't very meaningful at a glance on a PR, particularly for someone unfamiliar with the project, I imagine.

 

Status checks cannot be grouped. Sorting them by creation date could be a nice new feature. Would that work for you? I can suggest that to my team.

 

Copilot Lvl 3
Message 3 of 3

Re: GitHub Actions Tips (particularly regarding filters)

Hi @gimenete 

 

Yes, ordering the actions chronologically in the PR view would be very helpful I think.