name: Generate Clover Diffs
on:
pull_request:
paths:
- '.github/workflows/asset-diff.yml'
- 'bin/clover/**'
- 'bin/hoist/**'
- 'lib/si-pkg/**'
- 'lib/jsr-systeminit/cf-db/**'
jobs:
generate-diff:
runs-on: ubuntu-latest
env:
SI_BEARER_TOKEN: ${{ secrets.SI_BEARER_TOKEN }}
SI_MODULE_INDEX_URL: "https://module-index.systeminit.com"
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
- uses: dtolnay/rust-toolchain@stable
- name: Generate Specs
run: |
cd bin/clover
LOG_LEVEL=debug deno task run generate-specs --provider=all --force-update-existing-packages
- name: Generate Diff
run: |
cd bin/hoist
cargo build
if ../../target/debug/hoist get-diff-summary -t ../clover/si-specs --markdown > diff.md 2> err.log; then
echo "Diff generated successfully"
else
cat err.log > diff.md
fi
- name: Post Diff to PR
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const diff = fs.readFileSync('./bin/hoist/diff.md', 'utf8');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: diff
})