spenserblack / actions-wiki

:open_book: Deploy docs from your source tree to a GitHub wiki
https://github.com/marketplace/actions/wiki-update
MIT License
9 stars 2 forks source link

Support ignoring files in the wiki folder #49

Open spenserblack opened 1 year ago

spenserblack commented 1 year ago

Random idea I had in https://github.com/spenserblack/actions-wiki/discussions/46#discussioncomment-5405598

Possibly implementations:

Workarounds: A .gitignore in the wiki folder, combined with force-added files via git add -f path/to/wiki/file, should track the files in the repo, but ignore them when pushing to the repo. Untested.

jcbhmr commented 1 year ago

This is supported in my experiment here! https://github.com/Andrew-Chen-Wang/github-wiki-action/tree/jcbhmr

I use:

echo "$INPUT_IGNORE" >>"$GIT_DIR/info/exclude"

where

- uses: action/action@v1
  with:
    ignore: |
      file.cpp
      *.test.md
      *.json
      !package.json
spenserblack commented 1 year ago

Interesting! So .git/info/exclude is effectively identical to .gitignore? Negating matches, etc.?

jcbhmr commented 1 year ago

it seems like .git/info/exclude is your own custom .gitignore that's specific to your project. Sort of like the ~/.gitignore or whatever you set your global .gitignore to, but on a per-project level. It doesn't get synced up with the remotes, so you can:

But, sometimes you just with that git stop showing you that file you had to change for some reason we are not here to discuss.

https://luisdalmolin.dev/blog/ignoring-files-in-git-without-gitignore/

image

https://git-scm.com/docs/gitignore