1212 - " pattern-categorization/package.json"
1313 - " pattern-categorization/gl/*"
1414 - " pattern-categorization/pt-br/*"
15+ - " pattern-categorization/es/*"
1516
1617defaults :
1718 run :
@@ -21,34 +22,44 @@ jobs:
2122 generate-mindmap :
2223 runs-on : ubuntu-latest
2324
24- strategy :
25- matrix :
26- folder : [".", "./gl", "./pt-br"]
25+ permissions :
26+ # Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
27+ contents : write
2728
2829 steps :
29- - uses : actions/checkout@v3
30+ - uses : actions/checkout@v5
3031 - name : Use Node.js
31- uses : actions/setup-node@v3
32+ uses : actions/setup-node@v5
3233 with :
33- node-version : 16
34+ node-version : 20
3435 cache : ' npm'
3536 cache-dependency-path : pattern-categorization/package-lock.json
3637 - name : Install Node.js dependencies
3738 run : npm install
38- - name : Run Markmap
39- run : npx markmap --no-toolbar ${{ matrix.folder }}/innersource-program-mind-map.md -o ${{ matrix.folder }}/innersource-program-mind-map.html
40- - name : Screenshot Markmap Website
41- id : screenshot-generator
42- uses : swinton/screenshot-website@v1.x
43- with :
44- source : pattern-categorization/${{ matrix.folder }}/innersource-program-mind-map.html # strange syntax here. seems to not respect the working-directory default either
45- destination : innersource-program-mind-map.png
46- full-page : false
47- - name : Copy Screenshot
48- run : cp ${{ steps.screenshot-generator.outputs.path }} ${{ matrix.folder }}
49- - name : Reduce Screenshot Size (PNG)
50- run : npx optipng ${{ matrix.folder }}/innersource-program-mind-map.png
39+ - name : Disable AppArmor
40+ run : |
41+ # Disable AppArmor for unprivileged user namespaces (required for 'pageres')
42+ sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
43+ - name : Generate mindmap and take screenshot
44+ run : |
45+ # Loops over the top-level folder and all immediate sub-folders, except for "node_modules"
46+ for dir in . */; do
47+ # Skip node_modules
48+ [ "$(basename "$dir")" = "node_modules" ] && continue
49+
50+ echo "Creating mindmap PNG for: $dir"
51+ (
52+ # Create markmap HTML
53+ npx markmap --no-open --no-toolbar $dir/innersource-program-mind-map.md -o $dir/innersource-program-mind-map.html
54+
55+ # Take the screenshot
56+ npx pageres $dir/innersource-program-mind-map.html --overwrite --filename=$dir/innersource-program-mind-map 2560x1600
57+
58+ # Reduce Screenshot Size (PNG)
59+ npx optipng -silent $dir/innersource-program-mind-map.png
60+ )
61+ done
5162 - name : Commit Changes
52- uses : stefanzweifel/git-auto-commit-action@v4
63+ uses : stefanzweifel/git-auto-commit-action@v6
5364 with :
5465 commit_message : Re-creating markmap and screenshot
0 commit comments