github-rest-api 0.46.0__tar.gz → 0.47.1__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.
- github_rest_api-0.47.1/.github/workflows/claude-code-review.yml +44 -0
- github_rest_api-0.47.1/.github/workflows/claude.yml +50 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/PKG-INFO +1 -1
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/create_github_repo.py +35 -17
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/pyproject.toml +1 -1
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/uv.lock +1 -1
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/.devcontainer/devcontainer.json +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/.github/workflows/create_pr_to_main.yaml +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/.github/workflows/lint.yaml +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/.github/workflows/release.yaml +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/.github/workflows/remove_branch.yaml +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/.github/workflows/test.yaml +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/.gitignore +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/GEMINI.md +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/README.md +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/__init__.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/github.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/pr_content.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/__init__.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/cargo/__init__.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/cargo/benchmark.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/cargo/profiling.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/cargo/utils.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/container/__init__.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/container/build_container_images.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/container/config_container.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/container/update_version_containerfile.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/__init__.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/auto_merge_pull_request.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/create_pull_request.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/release_on_github.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/remove_branch.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/workflows/create_pr_dev_to_main.yaml +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/workflows/create_pr_to_dev.yaml +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/workflows/create_pr_to_main.yaml +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/workflows/python/lint.yaml +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/workflows/python/test.yaml +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/workflows/remove_branch.yaml +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/utils.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/utils.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/memory/MEMORY.md +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/memory/feedback_test_runner.md +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/tests/__init__.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/tests/test_build_container_images.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/tests/test_create_pull_request.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/tests/test_github.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/tests/test_pr_content.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/tests/test_release_on_github.py +0 -0
- {github_rest_api-0.46.0 → github_rest_api-0.47.1}/tests/test_utils.py +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Claude Code Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize, ready_for_review, reopened]
|
|
6
|
+
# Optional: Only run on specific file changes
|
|
7
|
+
# paths:
|
|
8
|
+
# - "src/**/*.ts"
|
|
9
|
+
# - "src/**/*.tsx"
|
|
10
|
+
# - "src/**/*.js"
|
|
11
|
+
# - "src/**/*.jsx"
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
claude-review:
|
|
15
|
+
# Optional: Filter by PR author
|
|
16
|
+
# if: |
|
|
17
|
+
# github.event.pull_request.user.login == 'external-contributor' ||
|
|
18
|
+
# github.event.pull_request.user.login == 'new-developer' ||
|
|
19
|
+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
|
20
|
+
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
24
|
+
pull-requests: read
|
|
25
|
+
issues: read
|
|
26
|
+
id-token: write
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: Checkout repository
|
|
30
|
+
uses: actions/checkout@v4
|
|
31
|
+
with:
|
|
32
|
+
fetch-depth: 1
|
|
33
|
+
|
|
34
|
+
- name: Run Claude Code Review
|
|
35
|
+
id: claude-review
|
|
36
|
+
uses: anthropics/claude-code-action@v1
|
|
37
|
+
with:
|
|
38
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
39
|
+
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
|
|
40
|
+
plugins: 'code-review@claude-code-plugins'
|
|
41
|
+
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
|
|
42
|
+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
43
|
+
# or https://code.claude.com/docs/en/cli-reference for available options
|
|
44
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Claude Code
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issue_comment:
|
|
5
|
+
types: [created]
|
|
6
|
+
pull_request_review_comment:
|
|
7
|
+
types: [created]
|
|
8
|
+
issues:
|
|
9
|
+
types: [opened, assigned]
|
|
10
|
+
pull_request_review:
|
|
11
|
+
types: [submitted]
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
claude:
|
|
15
|
+
if: |
|
|
16
|
+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
17
|
+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
18
|
+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
|
19
|
+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
pull-requests: read
|
|
24
|
+
issues: read
|
|
25
|
+
id-token: write
|
|
26
|
+
actions: read # Required for Claude to read CI results on PRs
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout repository
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 1
|
|
32
|
+
|
|
33
|
+
- name: Run Claude Code
|
|
34
|
+
id: claude
|
|
35
|
+
uses: anthropics/claude-code-action@v1
|
|
36
|
+
with:
|
|
37
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
38
|
+
|
|
39
|
+
# This is an optional setting that allows Claude to read CI results on PRs
|
|
40
|
+
additional_permissions: |
|
|
41
|
+
actions: read
|
|
42
|
+
|
|
43
|
+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
|
|
44
|
+
# prompt: 'Update the pull request description to include a summary of changes.'
|
|
45
|
+
|
|
46
|
+
# Optional: Add claude_args to customize behavior and configuration
|
|
47
|
+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
48
|
+
# or https://code.claude.com/docs/en/cli-reference for available options
|
|
49
|
+
# claude_args: '--allowed-tools Bash(gh pr *)'
|
|
50
|
+
|
|
@@ -38,6 +38,24 @@ def _remote_url(repo: str, protocol: str) -> str:
|
|
|
38
38
|
return f"https://github.com/{repo}.git"
|
|
39
39
|
|
|
40
40
|
|
|
41
|
+
def _ensure_remote(path: Path, repo: str, protocol: str) -> None:
|
|
42
|
+
try:
|
|
43
|
+
porcelain.remote_add(path, "origin", _remote_url(repo, protocol))
|
|
44
|
+
except porcelain.RemoteExists:
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _active_branch(path: Path) -> str:
|
|
49
|
+
try:
|
|
50
|
+
return porcelain.active_branch(path).decode()
|
|
51
|
+
except (IndexError, ValueError) as e:
|
|
52
|
+
raise ValueError(
|
|
53
|
+
f"HEAD of the local repo at '{path}' is detached (not on any branch), "
|
|
54
|
+
"which is unsupported (this happens, e.g., with a colocated Jujutsu repo). "
|
|
55
|
+
"Check out a branch (e.g. `git switch -c main`) before running this command."
|
|
56
|
+
) from e
|
|
57
|
+
|
|
58
|
+
|
|
41
59
|
def _init_local_repo(
|
|
42
60
|
repo: str,
|
|
43
61
|
language: str,
|
|
@@ -54,29 +72,29 @@ def _init_local_repo(
|
|
|
54
72
|
readme.write_text(f"# {repo_name}\n")
|
|
55
73
|
if not (path / ".git").exists():
|
|
56
74
|
porcelain.init(path=path)
|
|
57
|
-
|
|
58
|
-
initial_branch = (
|
|
59
|
-
|
|
60
|
-
)
|
|
61
|
-
porcelain.add(repo=path)
|
|
75
|
+
if not porcelain.branch_list(path):
|
|
76
|
+
initial_branch = _active_branch(path)
|
|
77
|
+
porcelain.add(repo=path, paths=["README.md"])
|
|
62
78
|
porcelain.commit(repo=path, message="first commit")
|
|
63
|
-
|
|
64
|
-
def _create_push_branch(branch: str):
|
|
79
|
+
for branch in branches:
|
|
65
80
|
if branch != initial_branch:
|
|
66
81
|
porcelain.branch_create(repo=path, name=branch)
|
|
67
|
-
porcelain.checkout(repo=path, target=branch)
|
|
68
|
-
porcelain.push(
|
|
69
|
-
repo=path,
|
|
70
|
-
remote_location=_remote_url(repo, "https"),
|
|
71
|
-
username="x-access-token",
|
|
72
|
-
password=token,
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
for branch in branches:
|
|
76
|
-
_create_push_branch(branch)
|
|
77
82
|
porcelain.checkout(repo=path, target=branches[0])
|
|
78
83
|
if initial_branch not in branches:
|
|
79
84
|
porcelain.branch_delete(repo=path, name=initial_branch)
|
|
85
|
+
_ensure_remote(path, repo, protocol)
|
|
86
|
+
local_branches = {b.decode() for b in porcelain.branch_list(path)}
|
|
87
|
+
branches_to_push = [branch for branch in branches if branch in local_branches]
|
|
88
|
+
if not branches_to_push:
|
|
89
|
+
branches_to_push = [_active_branch(path)]
|
|
90
|
+
for branch in branches_to_push:
|
|
91
|
+
porcelain.push(
|
|
92
|
+
repo=path,
|
|
93
|
+
remote_location=_remote_url(repo, "https"),
|
|
94
|
+
refspecs=[branch.encode()],
|
|
95
|
+
username="x-access-token",
|
|
96
|
+
password=token,
|
|
97
|
+
)
|
|
80
98
|
_add_workflow(path, language)
|
|
81
99
|
|
|
82
100
|
|
|
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
|
{github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/cargo/benchmark.py
RENAMED
|
File without changes
|
{github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/cargo/profiling.py
RENAMED
|
File without changes
|
|
File without changes
|
{github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/container/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_rest_api-0.46.0 → github_rest_api-0.47.1}/github_rest_api/scripts/github/remove_branch.py
RENAMED
|
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
|