Skip to content

Github Action that diffs the built Jekyll site after a change, and comments the result back to GitHub.

License

Notifications You must be signed in to change notification settings

David-Byrne/jekyll-diff-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jekyll Diff Action

A Github Action that diffs the built Jekyll site after a change, and comments the result back to GitHub.

Getting Started

Create a workflow file (e.g. jekyll-diff.yml) in your-repo/.github/workflows/ directory, similar to:

name: Jekyll diff
on: [push, pull_request]

jobs:
  diff-site:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - uses: David-Byrne/[email protected]
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

If you don't want the action to run on both commits and PRs, remove whichever trigger you don't need. The GITHUB_TOKEN is required to allow the action comment the diff back on GitHub.

And that's pretty much it! From now on, any changes you make on GitHub should have a comment showing their impact on the final version of your site, like this:

--- /tmp/old/hello.html
+++ /tmp/new/hello.html
@@ -1 +1 @@
-<h1>hello world</h1>
+<h1>Hello World!</h1>

While simple markdown updates usually result in trivial HTML changes, (e.g. the diff above), bumping dependencies or adding new plugins can cause many hard to detect issues. This is where jekyll-diff-action really shines, nothing on your site changes without your knowledge.

Licence

Jekyll diff action is released under an MIT licence.

About

Github Action that diffs the built Jekyll site after a change, and comments the result back to GitHub.

Topics

Resources

License

Stars

Watchers

Forks