The goal here is to ensure that the snippets generated from a given file/directory are up-to-date with the source files they're generated from via CI/CD in a reusable way.
The action should accept the path for a file or directory and run bluehawk snip on it.
Then, it should compare the output of the snippets it created with those in the PR branch (e.g. with git diff or md5 hashing if we have to).
If the snippets are identical, the action succeeds.
Otherwise, the action fails and reports out-of-date snippets & source files in the GHA stdout.
name: Ensure Node.js Bluehawk Snippets Are Up To Date
on:
pull_request:
paths:
- "examples/node/**"
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: mongodb-university/bluehawk/github-actions/check-snip@main
with:
source: examples/node/Examples
output: source/examples/generated/node
The goal here is to ensure that the snippets generated from a given file/directory are up-to-date with the source files they're generated from via CI/CD in a reusable way.
The action should accept the path for a file or directory and run
bluehawk snip
on it.Then, it should compare the output of the snippets it created with those in the PR branch (e.g. with
git diff
or md5 hashing if we have to).If the snippets are identical, the action succeeds.
Otherwise, the action fails and reports out-of-date snippets & source files in the GHA stdout.
Example failure output: