Start one-time import of original Medusa ZIP from Drive
davoodmehraban89 committed
Oct 13, 2026 at 15:54 UTC
25aaf259b48cd8ff05b7cb38f888eeddf941d197
1 file changed
+52
.github/workflows/import-medusa-source.yml
new
+52
@@ -0,0 +1,52 @@
1
+name: One-time Medusa source import
2
+on:
3
+ push:
4
+ paths:
5
+ - .github/workflows/import-medusa-source.yml
6
+permissions:
7
+ contents: write
8
+jobs:
9
+ import:
10
+ runs-on: ubuntu-latest
11
+ timeout-minutes: 60
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ with:
15
+ persist-credentials: true
16
+ fetch-depth: 1
17
+ - name: Download exact source ZIP
18
+ run: |
19
+ python -m pip install --quiet gdown
20
+ gdown --id 1s21CvVWexMKfHp3qU0SNc0GDTi0_BnuI --output /tmp/medusa-develop.zip
21
+ test "$(stat -c%s /tmp/medusa-develop.zip)" = 61017629
22
+ - name: Extract source without rewriting files
23
+ run: |
24
+ python - <<'PY'
25
+ from pathlib import Path
26
+ from zipfile import ZipFile
27
+ import shutil
28
+ root=Path.cwd().resolve()
29
+ with ZipFile('/tmp/medusa-develop.zip') as z:
30
+ files=[i for i in z.infolist() if not i.is_dir()]
31
+ assert len(files)==24261, f'Unexpected file count: {len(files)}'
32
+ assert z.testzip() is None
33
+ for info in files:
34
+ path=Path(info.filename)
35
+ assert path.parts[0]=='medusa-develop' and len(path.parts)>1
36
+ relative=Path(*path.parts[1:])
37
+ assert not relative.is_absolute() and '..' not in relative.parts
38
+ dest=(root/relative).resolve()
39
+ assert dest.is_relative_to(root)
40
+ dest.parent.mkdir(parents=True,exist_ok=True)
41
+ with z.open(info) as src, dest.open('wb') as dst:
42
+ shutil.copyfileobj(src,dst)
43
+ print('Extracted',len(files),'files')
44
+ PY
45
+ - name: Commit imported source and remove temporary workflow
46
+ run: |
47
+ rm .github/workflows/import-medusa-source.yml
48
+ git config user.name "github-actions[bot]"
49
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
50
+ git add -A
51
+ git commit -m "Import original Medusa source archive without modifications"
52
+ git push origin HEAD:main