rayluo / github-pages-overwriter

A Github Action that overwrites your Github Pages branch with the content of current workdir, thus deploy/publish without polluting your repo history.
MIT License
38 stars 2 forks source link

Duplicate references appear when using GitHub "#" syntax in commit message #1

Closed Mark-LaCroix closed 1 year ago

Mark-LaCroix commented 2 years ago

Using this Action results in a duplicate of the latest commit on the main branch. This itself is fine, but when a commit message references a GitHub issue using the "#" syntax, two identical messages appear in the issue log.

image

Worse, when the next commit comes, and the previous duplicate commit is removed, the reference to it in the issue log remains but becomes a dead link.

For my use case, this is ultimately worth the tremendous utility of this Action, but it kinda breaks GitHub's issue workflow integration, so I wonder if it's fixable.

rayluo commented 2 years ago

Hi Robot - hmm, I mean, Mark - thanks for your interest in Github Page Overwriter (GPO)!

Yeah, I noticed that inconvenience of the (seemingly) duplicated commit when I used GPO in my own projects (like this one), too. I did not previously bother look deep into it, but since you brought this up now, I gave it another look. After investigation, it seems it is an unfortunate side effect of using non-default source-directory. (Your project does that, too.) I'll need more time to see whether there would be a fix for it.

Meanwhile, may I suggest the workaround as "refrain from mentioning a github issue in your commit message"? It may not sound like the solution you are seeking for, but, in my own git/github experience, it is usually difficult to get things right in one single commit (unless, well, your screenshot above was about a typo). Normally I would push my commit(s) to a new branch and start a PR for it - regardless of whether I anticipate any discussion in that PR - and then later I can reference or close the corresponding issue from that PR. In this workflow, GPO's duplicated commits won't harm.