Document 1.0.3 import and glob changes #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: dir2md Blueprint | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
workflow_dispatch: | |
jobs: | |
build-blueprint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install dir2md | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
- name: Generate blueprint | |
id: gen | |
run: | | |
dir2md . --capsule --emit-manifest --stats -o DIR2MD_BLUEPRINT.md || true | |
TOKENS=$(jq .stats.est_tokens_prompt DIR2MD_BLUEPRINT.manifest.json 2>/dev/null || echo "0") | |
echo "tokens=$TOKENS" >> $GITHUB_OUTPUT | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dir2md-blueprint | |
path: | | |
DIR2MD_BLUEPRINT.md | |
DIR2MD_BLUEPRINT.manifest.json | |
DIR2MD_BLUEPRINT.capsule.zip | |
- name: Comment PR | |
if: github.event_name == 'pull_request' | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const tokens = '${{ steps.gen.outputs.tokens }}'; | |
const body = [ | |
'## 📦 dir2md Blueprint', | |
`- Estimated prompt tokens: **${tokens}**`, | |
'- Artifacts: _see workflow run → Artifacts_', | |
'', | |
'Run locally:', | |
'```bash', | |
'pip install .', | |
'dir2md .', | |
'```' | |
].join('\n'); | |
github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
body | |
}); |