Skip to content

Commit 97ece10

Browse files
committed
Using loop in script, rather than parallel job executions
1 parent 36ca4f6 commit 97ece10

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

.github/workflows/generate-mindmap.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ jobs:
2626
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
2727
contents: write
2828

29-
strategy:
30-
max-parallel: 1
31-
matrix:
32-
folder: [".", "./gl", "./pt-br", "./es"]
33-
34-
concurrency:
35-
group: ${{ github.workflow }}-${{ github.ref }}
36-
cancel-in-progress: false
37-
3829
steps:
3930
- uses: actions/checkout@v5
4031
with:
@@ -48,21 +39,29 @@ jobs:
4839
cache-dependency-path: pattern-categorization/package-lock.json
4940
- name: Install Node.js dependencies
5041
run: npm install
51-
- name: Run Markmap
52-
run: npx markmap --no-toolbar ${{ matrix.folder }}/innersource-program-mind-map.md -o ${{ matrix.folder }}/innersource-program-mind-map.html
53-
- name: Screenshot Markmap Website
42+
- name: Generate mindmap and take screenshot
5443
run: |
55-
# Disable AppArmor for unprivileged user namespaces
44+
# Disable AppArmor for unprivileged user namespaces (required for 'pageres')
5645
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
57-
# Take the screenshot
58-
npx pageres ${{ matrix.folder }}/innersource-program-mind-map.html --overwrite --filename=${{ matrix.folder }}/innersource-program-mind-map 2560x1600
59-
- name: Reduce Screenshot Size (PNG)
60-
run: npx optipng ${{ matrix.folder }}/innersource-program-mind-map.png
61-
# - name: Commit Changes
62-
# uses: stefanzweifel/git-auto-commit-action@v6
63-
# with:
64-
# commit_message: Re-creating markmap and screenshot for ${{ matrix.folder }}
46+
47+
# Loops over the top-level folder and all immediate sub-folders, except for "node_modules"
48+
for dir in . */; do
49+
# Skip node_modules
50+
[ "$(basename "$dir")" = "node_modules" ] && continue
51+
52+
echo "Creating mindmap PNG for: $dir"
53+
(
54+
# Create markmap HTML
55+
npx markmap --no-open --no-toolbar $dir/innersource-program-mind-map.md -o $dir/innersource-program-mind-map.html
56+
57+
# Take the screenshot
58+
npx pageres $dir/innersource-program-mind-map.html --overwrite --filename=$dir/innersource-program-mind-map 2560x1600
59+
60+
# Reduce Screenshot Size (PNG)
61+
npx optipng $dir/innersource-program-mind-map.png
62+
)
63+
done
6564
- name: Commit Changes
66-
uses: EndBug/add-and-commit@v9
65+
uses: stefanzweifel/git-auto-commit-action@v6
6766
with:
68-
message: Re-creating markmap and screenshot for ${{ matrix.folder }}
67+
commit_message: Re-creating markmap and screenshot

0 commit comments

Comments
 (0)