copycat-action
copycat-action copied to clipboard
Exclude not working for me
Hello,
For some reason I am not able to get the exclude to work. It is copying the wofklow action itself in to the destination repository. I am sure I am just not doing the globs right. Any help on my config would help:
- name: Copy
uses: andstor/copycat-action@v3
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
src_path: /.
dst_path: /site1/
dst_owner: woodman231
dst_repo_name: woodman231.github.io
exclude: /.github/*
clean: true
I even tried exclude: */.github/* but then it tells me that is an invalid token and won't allow me to save the yml file.
+1
+1
Hi !
Internally, the exclusion pattern matching is done against a string path. However, it seems that the this string path does not include a leading slash. So currently, to ignore top level files or directories, just don't include a slash at the beginning of the exclude expression. To ignore the .github
folder in the root directory, just set the exclude
pattern to .github/*
.
However, as it is normal to address a root path with a leading slash, this might be beneficial to implement. This would be a breaking change, so we need to be sure that this is the most intuitive and conventional solution. The actual fix seems to be rather simple.
Just change this line: https://github.com/andstor/copycat-action/blob/0d78a5b62732ca0cd61f353be769a3695a38607c/entrypoint.sh#L107 to this:
[[ "/$f" == $EXCLUDE ]] && continue
This would make it possible to exclude the root directory with the pattern /.github/*
or */.github/*
. However, the pattern .github
would no longer work.
Feedback is much appreciated 🙏
it wasn't working for me either and I figured it out by experimentation. Even though it is a breaking change, I highly encourage to implement it.
Is it possible to exclude more than one folder?