ChatCDN 0.1.1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chatcdn-0.1.2/.github/workflows/ci.yml +38 -0
- chatcdn-0.1.2/.github/workflows/preview.yaml +59 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/.github/workflows/publish.yml +18 -22
- {chatcdn-0.1.1 → chatcdn-0.1.2}/CHANGELOG.md +10 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/PKG-INFO +2 -2
- {chatcdn-0.1.1 → chatcdn-0.1.2}/mkdocs.yml +3 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/pyproject.toml +1 -1
- {chatcdn-0.1.1 → chatcdn-0.1.2}/src/ChatCDN.egg-info/PKG-INFO +2 -2
- {chatcdn-0.1.1 → chatcdn-0.1.2}/src/ChatCDN.egg-info/SOURCES.txt +3 -1
- {chatcdn-0.1.1 → chatcdn-0.1.2}/src/ChatCDN.egg-info/requires.txt +1 -1
- {chatcdn-0.1.1 → chatcdn-0.1.2}/src/chatcdn/__init__.py +1 -1
- chatcdn-0.1.2/tests/test_docs_contract.py +27 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/tests/test_version.py +1 -1
- chatcdn-0.1.2/tests/test_workflow_contract.py +32 -0
- chatcdn-0.1.1/.github/workflows/ci.yml +0 -26
- chatcdn-0.1.1/.github/workflows/preview.yaml +0 -54
- {chatcdn-0.1.1 → chatcdn-0.1.2}/.github/workflows/deploy.yaml +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/AGENTS.md +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/DEVELOP.md +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/LICENSE +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/MANIFEST.in +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/README.en.md +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/README.md +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/docs/capability-map.en.md +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/docs/capability-map.md +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/docs/cli-tree.en.md +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/docs/cli-tree.md +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/docs/index.en.md +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/docs/index.md +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/docs/interface-tree.md +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/setup.cfg +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/src/ChatCDN.egg-info/dependency_links.txt +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/src/ChatCDN.egg-info/entry_points.txt +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/src/ChatCDN.egg-info/top_level.txt +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/src/chatcdn/cli.py +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/src/chatcdn/config.py +0 -0
- {chatcdn-0.1.1 → chatcdn-0.1.2}/tests/test_cli.py +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
pull_request:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- name: Configure Git Credentials
|
|
19
|
+
run: |
|
|
20
|
+
git config user.name github-actions[bot]
|
|
21
|
+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
22
|
+
- uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.10"
|
|
25
|
+
- name: Install package and test dependencies
|
|
26
|
+
run: python -m pip install --upgrade pip && python -m pip install -e ".[dev,docs]"
|
|
27
|
+
- name: Run tests
|
|
28
|
+
run: python -m pytest -q
|
|
29
|
+
- name: Build docs
|
|
30
|
+
run: mkdocs build --strict
|
|
31
|
+
- name: Smoke installed CLI
|
|
32
|
+
run: |
|
|
33
|
+
chatcdn --version
|
|
34
|
+
chatcdn --tree
|
|
35
|
+
- name: Build distributions
|
|
36
|
+
run: python -m build
|
|
37
|
+
- name: Check distributions
|
|
38
|
+
run: python -m twine check dist/*
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Preview Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
pull-requests: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
deploy:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
if: ${{ !github.event.pull_request.head.repo.fork }}
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- name: Configure Git Credentials
|
|
20
|
+
run: |
|
|
21
|
+
git config user.name github-actions[bot]
|
|
22
|
+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
23
|
+
- uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.10"
|
|
26
|
+
- name: Install docs dependencies
|
|
27
|
+
run: python -m pip install --upgrade pip && python -m pip install -e ".[docs]"
|
|
28
|
+
- name: Deploy preview docs
|
|
29
|
+
run: |
|
|
30
|
+
git fetch origin gh-pages || true
|
|
31
|
+
mike deploy dev -p --allow-empty
|
|
32
|
+
site_url=$(python - <<'PY'
|
|
33
|
+
from pathlib import Path
|
|
34
|
+
for line in Path("mkdocs.yml").read_text(encoding="utf-8").splitlines():
|
|
35
|
+
if line.startswith("site_url:"):
|
|
36
|
+
print(line.split(":", 1)[1].strip().rstrip("/"))
|
|
37
|
+
break
|
|
38
|
+
else:
|
|
39
|
+
raise SystemExit("mkdocs.yml is missing site_url")
|
|
40
|
+
PY
|
|
41
|
+
)
|
|
42
|
+
preview_url="${site_url}/dev/"
|
|
43
|
+
echo "CHATARCH_PREVIEW_URL=${preview_url}" >> "$GITHUB_ENV"
|
|
44
|
+
echo "Preview URL: ${preview_url}" >> "$GITHUB_STEP_SUMMARY"
|
|
45
|
+
- name: Comment PR with Preview Link
|
|
46
|
+
uses: actions/github-script@v7
|
|
47
|
+
with:
|
|
48
|
+
script: |
|
|
49
|
+
const marker = '<!-- chatcdn-preview-docs -->';
|
|
50
|
+
const previewLink = process.env.CHATARCH_PREVIEW_URL;
|
|
51
|
+
const body = `${marker}\nPreview Docs: ${previewLink}`;
|
|
52
|
+
const { payload, repo } = context;
|
|
53
|
+
const comments = await github.rest.issues.listComments({ owner: repo.owner, repo: repo.repo, issue_number: payload.number });
|
|
54
|
+
const existing = comments.data.find(comment => comment.body.includes(marker));
|
|
55
|
+
if (existing) {
|
|
56
|
+
await github.rest.issues.updateComment({ owner: repo.owner, repo: repo.repo, comment_id: existing.id, body });
|
|
57
|
+
} else {
|
|
58
|
+
await github.rest.issues.createComment({ owner: repo.owner, repo: repo.repo, issue_number: payload.number, body });
|
|
59
|
+
}
|
|
@@ -4,7 +4,6 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
tags:
|
|
6
6
|
- "v*"
|
|
7
|
-
workflow_dispatch:
|
|
8
7
|
|
|
9
8
|
permissions:
|
|
10
9
|
contents: read
|
|
@@ -45,7 +44,6 @@ jobs:
|
|
|
45
44
|
print(f"tag=v{version}", file=output)
|
|
46
45
|
PY
|
|
47
46
|
- name: Check tag matches package version
|
|
48
|
-
if: github.event_name == 'push'
|
|
49
47
|
env:
|
|
50
48
|
RELEASE_TAG: ${{ steps.meta.outputs.tag }}
|
|
51
49
|
run: |
|
|
@@ -53,8 +51,14 @@ jobs:
|
|
|
53
51
|
echo "Tag ${GITHUB_REF_NAME} does not match package version ${RELEASE_TAG}."
|
|
54
52
|
exit 1
|
|
55
53
|
fi
|
|
54
|
+
- name: Check release commit is on default branch
|
|
55
|
+
run: |
|
|
56
|
+
git fetch --no-tags origin main:refs/remotes/origin/main
|
|
57
|
+
if ! git merge-base --is-ancestor "${GITHUB_SHA}" "origin/main"; then
|
|
58
|
+
echo "Release commit ${GITHUB_SHA} is not reachable from origin/main."
|
|
59
|
+
exit 1
|
|
60
|
+
fi
|
|
56
61
|
- name: Check PyPI version
|
|
57
|
-
id: pypi
|
|
58
62
|
env:
|
|
59
63
|
PACKAGE_NAME: "ChatCDN"
|
|
60
64
|
PACKAGE_VERSION: ${{ steps.meta.outputs.version }}
|
|
@@ -68,27 +72,19 @@ jobs:
|
|
|
68
72
|
package = os.environ["PACKAGE_NAME"]
|
|
69
73
|
version = os.environ["PACKAGE_VERSION"]
|
|
70
74
|
url = f"https://pypi.org/pypi/{urllib.parse.quote(package)}/{urllib.parse.quote(version)}/json"
|
|
71
|
-
exists = "false"
|
|
72
75
|
try:
|
|
73
76
|
urllib.request.urlopen(url, timeout=10)
|
|
74
77
|
except urllib.error.HTTPError as exc:
|
|
75
|
-
if exc.code
|
|
76
|
-
raise
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output:
|
|
81
|
-
print(f"exists={exists}", file=output)
|
|
78
|
+
if exc.code == 404:
|
|
79
|
+
raise SystemExit(0)
|
|
80
|
+
raise
|
|
81
|
+
raise SystemExit(f"{package} {version} is already on PyPI")
|
|
82
82
|
PY
|
|
83
|
-
- name:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
run:
|
|
89
|
-
|
|
90
|
-
python -m build
|
|
91
|
-
python -m twine check dist/*
|
|
92
|
-
- name: Publish to PyPI
|
|
93
|
-
if: steps.pypi.outputs.exists == 'false'
|
|
83
|
+
- name: Install build tools
|
|
84
|
+
run: python -m pip install --upgrade pip build twine
|
|
85
|
+
- name: Build
|
|
86
|
+
run: python -m build
|
|
87
|
+
- name: Check dist
|
|
88
|
+
run: python -m twine check dist/*
|
|
89
|
+
- name: Publish to PyPI (OIDC)
|
|
94
90
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.2 - 2026-08-12
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Enable the MkDocs Material emoji renderer (`pymdownx.emoji` with Material `twemoji`/`to_svg`) for bilingual public docs.
|
|
8
|
+
- Relax the docs extra to `mkdocs-material>=9.5,<10.0`.
|
|
9
|
+
- Harden tag-driven PyPI publishing with package-version, default-branch, and PyPI exact-version guards.
|
|
10
|
+
- Add CI smoke checks for installed `chatcdn --version` and `chatcdn --tree`, plus distribution metadata checks.
|
|
11
|
+
- Derive Preview Docs links from `mkdocs.yml` `site_url`.
|
|
12
|
+
|
|
3
13
|
## 0.1.1 - 2026-08-10
|
|
4
14
|
|
|
5
15
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ChatCDN
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: ChatArch CDN tooling package.
|
|
5
5
|
Author-email: ChatArch <rex@chatarch.org>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -22,7 +22,7 @@ Requires-Dist: pytest; extra == "dev"
|
|
|
22
22
|
Requires-Dist: twine; extra == "dev"
|
|
23
23
|
Provides-Extra: docs
|
|
24
24
|
Requires-Dist: mkdocs<2.0,>=1.6; extra == "docs"
|
|
25
|
-
Requires-Dist: mkdocs-material<
|
|
25
|
+
Requires-Dist: mkdocs-material<10.0,>=9.5; extra == "docs"
|
|
26
26
|
Requires-Dist: mkdocs-static-i18n<2.0,>=1.2; extra == "docs"
|
|
27
27
|
Requires-Dist: mike<3.0,>=2.0; extra == "docs"
|
|
28
28
|
Dynamic: license-file
|
|
@@ -49,6 +49,9 @@ markdown_extensions:
|
|
|
49
49
|
- pymdownx.inlinehilite
|
|
50
50
|
- pymdownx.highlight:
|
|
51
51
|
anchor_linenums: true
|
|
52
|
+
- pymdownx.emoji:
|
|
53
|
+
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
|
54
|
+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
|
52
55
|
extra:
|
|
53
56
|
alternate:
|
|
54
57
|
- name: 中文
|
|
@@ -30,7 +30,7 @@ chatcdn = "chatcdn.config"
|
|
|
30
30
|
|
|
31
31
|
[project.optional-dependencies]
|
|
32
32
|
dev = ["build", "pytest", "twine"]
|
|
33
|
-
docs = ["mkdocs>=1.6,<2.0", "mkdocs-material>=9.5,<
|
|
33
|
+
docs = ["mkdocs>=1.6,<2.0", "mkdocs-material>=9.5,<10.0", "mkdocs-static-i18n>=1.2,<2.0", "mike>=2.0,<3.0"]
|
|
34
34
|
|
|
35
35
|
[tool.setuptools.dynamic]
|
|
36
36
|
version = {attr = "chatcdn.__version__"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ChatCDN
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: ChatArch CDN tooling package.
|
|
5
5
|
Author-email: ChatArch <rex@chatarch.org>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -22,7 +22,7 @@ Requires-Dist: pytest; extra == "dev"
|
|
|
22
22
|
Requires-Dist: twine; extra == "dev"
|
|
23
23
|
Provides-Extra: docs
|
|
24
24
|
Requires-Dist: mkdocs<2.0,>=1.6; extra == "docs"
|
|
25
|
-
Requires-Dist: mkdocs-material<
|
|
25
|
+
Requires-Dist: mkdocs-material<10.0,>=9.5; extra == "docs"
|
|
26
26
|
Requires-Dist: mkdocs-static-i18n<2.0,>=1.2; extra == "docs"
|
|
27
27
|
Requires-Dist: mike<3.0,>=2.0; extra == "docs"
|
|
28
28
|
Dynamic: license-file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_mkdocs_material_i18n_public_domain_and_icon_renderer():
|
|
5
|
+
mkdocs = Path("mkdocs.yml").read_text(encoding="utf-8")
|
|
6
|
+
pyproject = Path("pyproject.toml").read_text(encoding="utf-8")
|
|
7
|
+
|
|
8
|
+
assert "site_url: https://arch.gh.wzhecnu.cn/ChatCDN/" in mkdocs
|
|
9
|
+
assert "repo_url: https://github.com/ChatArch/ChatCDN" in mkdocs
|
|
10
|
+
assert "name: material" in mkdocs
|
|
11
|
+
assert "- i18n:" in mkdocs
|
|
12
|
+
assert "docs_structure: suffix" in mkdocs
|
|
13
|
+
assert "mkdocs-static-i18n" in pyproject
|
|
14
|
+
assert "mkdocs-material>=9.5,<10.0" in pyproject
|
|
15
|
+
assert "pymdownx.emoji" in mkdocs
|
|
16
|
+
assert "material.extensions.emoji.twemoji" in mkdocs
|
|
17
|
+
assert "material.extensions.emoji.to_svg" in mkdocs
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def test_cli_tree_docs_are_bilingual_and_use_public_command():
|
|
21
|
+
zh = Path("docs/cli-tree.md").read_text(encoding="utf-8")
|
|
22
|
+
en = Path("docs/cli-tree.en.md").read_text(encoding="utf-8")
|
|
23
|
+
|
|
24
|
+
assert "chatcdn --tree" in zh
|
|
25
|
+
assert "chatcdn --tree" in en
|
|
26
|
+
assert "python -m chatcdn.cli" not in zh
|
|
27
|
+
assert "python -m chatcdn.cli" not in en
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_publish_workflow_uses_oidc_with_release_guards():
|
|
5
|
+
workflow = Path(".github/workflows/publish.yml").read_text(encoding="utf-8")
|
|
6
|
+
|
|
7
|
+
assert "id-token: write" in workflow
|
|
8
|
+
assert "pypa/gh-action-pypi-publish@release/v1" in workflow
|
|
9
|
+
assert "Check tag matches package version" in workflow
|
|
10
|
+
assert "Check release commit is on default branch" in workflow
|
|
11
|
+
assert "git fetch --no-tags origin main:refs/remotes/origin/main" in workflow
|
|
12
|
+
assert "Check PyPI version" in workflow
|
|
13
|
+
assert "is already on PyPI" in workflow
|
|
14
|
+
assert "environment: pypi" not in workflow
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def test_ci_smokes_installed_cli_and_checks_distributions():
|
|
18
|
+
workflow = Path(".github/workflows/ci.yml").read_text(encoding="utf-8")
|
|
19
|
+
|
|
20
|
+
assert "chatcdn --version" in workflow
|
|
21
|
+
assert "chatcdn --tree" in workflow
|
|
22
|
+
assert "python -m twine check dist/*" in workflow
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def test_preview_workflow_derives_public_url_from_site_url():
|
|
26
|
+
workflow = Path(".github/workflows/preview.yaml").read_text(encoding="utf-8")
|
|
27
|
+
|
|
28
|
+
assert "site_url" in workflow
|
|
29
|
+
assert "CHATARCH_PREVIEW_URL" in workflow
|
|
30
|
+
assert "${site_url}/dev/" in workflow
|
|
31
|
+
assert "github.io" not in workflow
|
|
32
|
+
assert "Preview" in workflow
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
- master
|
|
8
|
-
pull_request:
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
test:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v4
|
|
15
|
-
- name: Configure Git Credentials
|
|
16
|
-
run: |
|
|
17
|
-
git config user.name github-actions[bot]
|
|
18
|
-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
19
|
-
- uses: actions/setup-python@v5
|
|
20
|
-
with:
|
|
21
|
-
python-version: "3.10"
|
|
22
|
-
- run: python -m pip install --upgrade pip
|
|
23
|
-
- run: python -m pip install -e ".[dev,docs]"
|
|
24
|
-
- run: python -m pytest -q
|
|
25
|
-
- run: python -m build
|
|
26
|
-
- run: mkdocs build --strict
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
name: Preview Docs
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
- master
|
|
8
|
-
|
|
9
|
-
permissions:
|
|
10
|
-
contents: write
|
|
11
|
-
pull-requests: write
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
deploy:
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
if: ${{ !github.event.pull_request.head.repo.fork }}
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v4
|
|
19
|
-
- name: Configure Git Credentials
|
|
20
|
-
run: |
|
|
21
|
-
git config user.name github-actions[bot]
|
|
22
|
-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
23
|
-
- uses: actions/setup-python@v5
|
|
24
|
-
with:
|
|
25
|
-
python-version: "3.10"
|
|
26
|
-
- run: python -m pip install --upgrade pip
|
|
27
|
-
- run: python -m pip install -e ".[docs]"
|
|
28
|
-
- run: |
|
|
29
|
-
git fetch origin
|
|
30
|
-
mike deploy dev -p --allow-empty
|
|
31
|
-
repo="${GITHUB_REPOSITORY#*/}"
|
|
32
|
-
preview_url="https://arch.gh.wzhecnu.cn/${repo}/dev/"
|
|
33
|
-
echo "Preview URL: ${preview_url}" >> "$GITHUB_STEP_SUMMARY"
|
|
34
|
-
|
|
35
|
-
- name: Comment PR with Preview Link
|
|
36
|
-
uses: actions/github-script@v6
|
|
37
|
-
with:
|
|
38
|
-
script: |
|
|
39
|
-
const { payload, repo } = context;
|
|
40
|
-
const previewLink = `https://arch.gh.wzhecnu.cn/${repo.repo}/dev/`;
|
|
41
|
-
const comments = await github.rest.issues.listComments({
|
|
42
|
-
owner: repo.owner,
|
|
43
|
-
repo: repo.repo,
|
|
44
|
-
issue_number: payload.number,
|
|
45
|
-
});
|
|
46
|
-
const existingComment = comments.data.find(comment => comment.body.includes(previewLink));
|
|
47
|
-
if (!existingComment) {
|
|
48
|
-
await github.rest.issues.createComment({
|
|
49
|
-
owner: repo.owner,
|
|
50
|
-
repo: repo.repo,
|
|
51
|
-
issue_number: payload.number,
|
|
52
|
-
body: `Preview available at: ${previewLink}`,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|