From f92274887414d05382a8eb2082c5ce10c625f182 Mon Sep 17 00:00:00 2001 From: williamfzc <178894043@qq.com> Date: Sat, 16 Dec 2023 13:19:23 +0800 Subject: [PATCH] chore: example of analysing issues --- .github/workflows/python-package.yml | 2 ++ examples/for_axios.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 14e37d5..524b7af 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -40,3 +40,5 @@ jobs: run: | git clone https://github.com/axios/axios.git poetry run python3 examples/for_axios.py + env: + GH_TOKEN: ${{ github.token }} diff --git a/examples/for_axios.py b/examples/for_axios.py index 8a9de7c..d40fe2b 100644 --- a/examples/for_axios.py +++ b/examples/for_axios.py @@ -1,4 +1,6 @@ +import os import pathlib +import subprocess import sys import warnings @@ -14,6 +16,11 @@ warnings.warn(f"clone axios to {axios_repo} first") sys.exit(0) +# dump gh issues +issue_json_file = "issues.json" +subprocess.check_call(f"gh issue list --json title,number --limit 5000 --state=all > {issue_json_file}", shell=True) +assert os.path.isfile(issue_json_file) + collector = Collector() collector.config.repo_root = axios_repo collector.config.max_depth_limit = -1 @@ -21,6 +28,7 @@ ctx = collector.collect_metadata() storage = Storage() +storage.config.load_issue_mapping_from_gh_json_file((axios_repo / issue_json_file).as_posix()) storage.embed_ctx(ctx) tagger = Tagger() tagger.config.tags = [