-
Notifications
You must be signed in to change notification settings - Fork 297
75 lines (65 loc) · 2.52 KB
/
Copy pathrich-codex.yml
File metadata and controls
75 lines (65 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Generate images for docs
on:
workflow_dispatch:
jobs:
rich_codex:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
# Use @nf-core-bot token to check out so we can push without a PR
token: ${{ secrets.NF_CORE_BOT_AUTH_TOKEN }}
# Add Node.js setup step
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: "24"
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: 3.14
- name: Remove type:module from package.json
run: |
if [ -f "$GITHUB_WORKSPACE/package.json" ]; then
sed -i '/"type": "module"/d' "$GITHUB_WORKSPACE/package.json"
echo "Removed type:module from package.json"
fi
- name: Install Nextflow
uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3
- name: Install nf-test
uses: nf-core/setup-nf-test@4069fbbaabe94c08faba4ad261bfa88225ba133f # v2
- name: Install nf-core/tools
run: pip install nf-core
- name: Generate terminal images with rich-codex
uses: ewels/rich-codex@80de9de011c994f32274bb4cffee140567621d8e # v1
env:
COLUMNS: 100
HIDE_PROGRESS: "true"
NXF_ANSI_LOG: false
with:
commit_changes: "false"
terminal_width: 100
skip_git_checks: "true"
search_include: ".github/workflows/rich-codex.yml"
- name: Decode HTML entities in generated SVGs
run: |
python3 -c "
import re, html, glob
for path in glob.glob('sites/docs/src/assets/images/**/*.svg', recursive=True):
content = open(path).read()
decoded = re.sub(r'&#[0-9]+;|&#x[0-9a-fA-F]+;', lambda m: html.unescape(m.group(0)), content)
if decoded != content:
open(path, 'w').write(decoded)
print(f'Decoded entities in {path}')
"
- name: Commit generated images
run: |
git config user.email "core@nf-co.re"
git config user.name "nf-core-bot"
git add --all
git diff --staged --quiet || git commit -m "[automated] Update rich-codex images"
git push
- name: Restore package.json
run: |
git checkout "$GITHUB_WORKSPACE/package.json"