'GitHub Action triggered on something like Fetch

I'll be using this GitHub Action in order to keep my Hugo Project in a private repository that will then, for the lack of better word, compile, and then publish the resulting static files to a public repository in which GitHub Pages has already been configured.

The YAML workflow for that is set to run on push, meaning whenever I push something new to the private repository, the Action is triggered and files on the public are updated.

Works perfectly except for one thing: If I create several posts with future dates, I'll effectively be committing them all at once, which means that most of the time I won't have anything relevant to push and, therefore, the Action will not be triggered.

Reading the docs I'm almost certain no other triggers would allow me, for example, to trigger the Action whenever a git fetch — assuming that's what GitHub Desktop does in the background automatically whenever switching repositories — is performed.

The trigger that seemed to me the less cumbersome to solve this workaround this matter was, if I understood it correctly, the watch, that would allow me to commit all future posts at once as intended and then trigger the Action simply by starring the private repository.

But, I'm not really sure if that's the best one and, hence, I'd like to know if there's an alternative — regardless of personal opinions, let's be clear.



Solution 1:[1]

Thanks to @matt in the comments I had the directions I needed and, after testing, it worked as intended.

I didn't know how to perform an empty commit, though, but it was easier than I thought:

git commit --allow-empty -m "Message"

However, it had to be done in command-line 'cause, by the time I'm writing this, GitHub Desktop doesn't support empty commits.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1