File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Generate Docs File List
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+
8+ jobs :
9+ build-file-list :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout repository
14+ uses : actions/checkout@v3
15+
16+ - name : Generate file list
17+ run : |
18+ echo "Generating docs file list..."
19+ FILES=$(find docs -type f ! -path "docs/static/*" | sed 's/^/"/;s/$/"/' | paste -sd "," -)
20+ echo "Found files: $FILES"
21+
22+ # Insert into package.json
23+ node - <<EOF
24+ const fs = require('fs');
25+ const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
26+ pkg.files = [${FILES}];
27+ fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));
28+ EOF
29+
30+ - name : Commit changes
31+ run : |
32+ git config --global user.name "github-actions"
33+ git config --global user.email "github-actions@github.com"
34+ git add package.json
35+ git commit -m "Auto-update docs file list" || echo "No changes to commit"
36+ git push
You can’t perform that action at this time.
0 commit comments