Skip to content

Fix for #128: Documentation enhancement for Github Actions#129

Merged
ekalinin merged 1 commit intoekalinin:masterfrom
jofas:enhanced_github_action_documentation
Mar 26, 2022
Merged

Fix for #128: Documentation enhancement for Github Actions#129
ekalinin merged 1 commit intoekalinin:masterfrom
jofas:enhanced_github_action_documentation

Conversation

@jofas
Copy link
Copy Markdown
Contributor

@jofas jofas commented Mar 21, 2022

Hi,

this PR enhances the example for use of this project with Github Actions. The problems I faced when I copy and pasted the example into my Github Action are described in issue #128.

Adding the --hide-footer flag makes sure that no unnecessary auto-commit is generated by the Gitub Action. For example, if you were to change the content of foo.md, but would leave the structure of its headlines intact, there is no need to generate a new TOC. gh-md-toc adds a footer comment to your TOC that reads something like <!-- Created by <user> at <datetime> -->. This changes every time gh-md-toc is executed at a different datetime. Hiding the footer makes running gh-md-toc idempotent, if the headers in foo.md do not change. This removes auto-commits by the Github Action even when the TOC does not change.

Adding the rm gh-md-toc line to the action removes the gh-md-toc script from the repository again, so it won't be added to the repo by the auto-commit of the Github Action.

@ekalinin ekalinin merged commit 877f061 into ekalinin:master Mar 26, 2022
@ekalinin
Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants