Act: Add ability to ignore files

Created on 18 Mar 2019  路  6Comments  路  Source: nektos/act

Currently, act will include the entire working directory in the container it builds (which does make sense in the context of a cloned repository, but not necessarily a local working copy).

For example, I may have dependencies built for my host operating system (MacOS), but they need to be rebuilt inside the container. This works fine in Actions in production because the dependencies aren't checked into the repository. However, I can't see a way of not sending them to the built container with act without rming them (which slows down local development on my host).

Perhaps there could be some sort of .ignore file that ignores files from the host, and also prevents those files from the container from being copied back to the host?

areaction kinfeature-request

Most helpful comment

How does this sound? When copying files into the job container, ignore any path referenced in .gitignore files. Would that solve your issues @muuvmuuv & @jclem ?

All 6 comments

@jclem can you add them to your .dockerignore file?

I am pretty sure I've already tried that, and that they were built into the container, anyway. I will double-check.

Having the same trouble. .dockerignore looks like that:

*/.cache
.git
.github
.now
.pnpm-store
.vscode
docker
node_modules
public
reports
tests
*/.eslintcache
*/.stylelintcache
*/.DS_Store

How does this sound? When copying files into the job container, ignore any path referenced in .gitignore files. Would that solve your issues @muuvmuuv & @jclem ?

Of course but shouldn't the .dockerignore work OOTB? I mean, having both to ignore files would be the "icing on the cake", since both can be different.

So .dockerignore is only helpful for the situations where we build an image for a local action of type docker and want to ignore things in the context of .github/workflows/...

In this case, we want to avoid passing other files that may be outside that context, for example node_modules.

Was this page helpful?
0 / 5 - 0 ratings