github2gerrit 0.1.7__tar.gz → 0.1.9__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.
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.pre-commit-config.yaml +6 -5
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/PKG-INFO +5 -5
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/README.md +4 -4
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/REUSE.toml +1 -0
- github2gerrit-0.1.9/docs/github2gerrit_token_permissions_classic.png +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/cli.py +7 -1
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/config.py +78 -1
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/github_api.py +2 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit.egg-info/PKG-INFO +5 -5
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit.egg-info/SOURCES.txt +1 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.editorconfig +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.github/actionlint.yaml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.github/dependabot.yml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.github/release-drafter.yml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.github/workflows/build-test-release.yaml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.github/workflows/build-test.yaml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.github/workflows/dependencies.yaml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.github/workflows/github2gerrit.yaml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.github/workflows/release-drafter.yaml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.github/workflows/semantic-pull-request.yaml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.github/workflows/sha-pinned-actions.yaml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.github/workflows/testing.yaml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.gitignore +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.gitlint +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.markdownlint.yaml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.readthedocs.yml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/.yamllint +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/LICENSE +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/LICENSES/Apache-2.0.txt +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/action.yaml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/pyproject.toml +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/setup.cfg +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/sitecustomize.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/__init__.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/commit_normalization.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/core.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/duplicate_detection.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/external_api.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/gerrit_rest.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/gerrit_urls.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/gitutils.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/models.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/pr_content_filter.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/similarity.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/ssh_agent_setup.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/ssh_common.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/ssh_discovery.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit/utils.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit.egg-info/dependency_links.txt +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit.egg-info/entry_points.txt +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit.egg-info/requires.txt +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/src/github2gerrit.egg-info/top_level.txt +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/conftest.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/fixtures/__init__.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/fixtures/make_repo.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_change_id_deduplication.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_cli.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_cli_helpers.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_cli_outputs_file.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_cli_url_and_dryrun.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_commit_normalization.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_config_and_reviewers.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_config_helpers.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_core_close_pr_policy.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_core_config_and_errors.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_core_gerrit_backref_comment.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_core_gerrit_push_errors.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_core_gerrit_rest_results.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_core_integration_fixture_repo.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_core_prepare_commits.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_core_ssh_setup.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_duplicate_detection.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_external_api_framework.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_gerrit_change_id_footer.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_gerrit_rest_client.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_gerrit_urls.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_gerrit_urls_more.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_ghe_and_gitreview_args.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_github_api_helpers.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_github_api_retry_and_helpers.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_gitutils_helpers.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_misc_small_coverage.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_pr_content_filter.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_pr_content_filter_integration.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_ssh_agent.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_ssh_common.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_ssh_discovery.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_url_parser.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/tests/test_utils.py +0 -0
- {github2gerrit-0.1.7 → github2gerrit-0.1.9}/uv.lock +0 -0
@@ -74,11 +74,12 @@ repos:
|
|
74
74
|
- types-PyYAML
|
75
75
|
- types-requests
|
76
76
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
77
|
+
# Doesn't seem to run reliably inside pre-commit.ci
|
78
|
+
# - repo: https://github.com/RobertCraigie/pyright-python
|
79
|
+
# rev: d393df1703a808473b84bd14a2702f4793014031 # frozen: v1.1.404
|
80
|
+
# hooks:
|
81
|
+
# - id: pyright
|
82
|
+
# files: ^(src|scripts|tests)/.+\.py$
|
82
83
|
|
83
84
|
- repo: https://github.com/btford/write-good
|
84
85
|
rev: ab66ce10136dfad5146e69e70f82a3efac8842c1 # frozen: v1.0.8
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: github2gerrit
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.9
|
4
4
|
Summary: Submit a GitHub pull request to a Gerrit repository.
|
5
5
|
Author-email: Matthew Watkins <mwatkins@linuxfoundation.org>
|
6
6
|
License-Expression: Apache-2.0
|
@@ -297,7 +297,7 @@ jobs:
|
|
297
297
|
steps:
|
298
298
|
- name: Submit PR to Gerrit
|
299
299
|
id: g2g
|
300
|
-
uses:
|
300
|
+
uses: lfreleng-actions/github2gerrit-action@main
|
301
301
|
with:
|
302
302
|
SUBMIT_SINGLE_COMMITS: "false"
|
303
303
|
USE_PR_AS_COMMIT: "false"
|
@@ -343,7 +343,7 @@ uv run github2gerrit
|
|
343
343
|
uvx github2gerrit https://github.com/owner/repo/pull/123
|
344
344
|
|
345
345
|
# Install from specific version/source
|
346
|
-
uvx --from git+https://github.com/
|
346
|
+
uvx --from git+https://github.com/lfreleng-actions/github2gerrit-action@main github2gerrit https://github.com/owner/repo/pull/123
|
347
347
|
```
|
348
348
|
|
349
349
|
### Available Options
|
@@ -524,7 +524,7 @@ jobs:
|
|
524
524
|
|
525
525
|
- name: Submit PR to Gerrit (with explicit overrides)
|
526
526
|
id: g2g
|
527
|
-
uses:
|
527
|
+
uses: lfreleng-actions/github2gerrit-action@main
|
528
528
|
with:
|
529
529
|
# Behavior
|
530
530
|
SUBMIT_SINGLE_COMMITS: "false"
|
@@ -777,7 +777,7 @@ For CI/CD pipelines (like GitHub Actions), use `uvx` to install and run without
|
|
777
777
|
uvx github2gerrit <PR_URL> --dry-run
|
778
778
|
|
779
779
|
# Install from a specific version or source
|
780
|
-
uvx --from git+https://github.com/
|
780
|
+
uvx --from git+https://github.com/lfreleng-actions/github2gerrit-action@main github2gerrit <PR_URL>
|
781
781
|
|
782
782
|
# Run with specific Python version
|
783
783
|
uvx --python 3.11 github2gerrit <PR_URL>
|
@@ -257,7 +257,7 @@ jobs:
|
|
257
257
|
steps:
|
258
258
|
- name: Submit PR to Gerrit
|
259
259
|
id: g2g
|
260
|
-
uses:
|
260
|
+
uses: lfreleng-actions/github2gerrit-action@main
|
261
261
|
with:
|
262
262
|
SUBMIT_SINGLE_COMMITS: "false"
|
263
263
|
USE_PR_AS_COMMIT: "false"
|
@@ -303,7 +303,7 @@ uv run github2gerrit
|
|
303
303
|
uvx github2gerrit https://github.com/owner/repo/pull/123
|
304
304
|
|
305
305
|
# Install from specific version/source
|
306
|
-
uvx --from git+https://github.com/
|
306
|
+
uvx --from git+https://github.com/lfreleng-actions/github2gerrit-action@main github2gerrit https://github.com/owner/repo/pull/123
|
307
307
|
```
|
308
308
|
|
309
309
|
### Available Options
|
@@ -484,7 +484,7 @@ jobs:
|
|
484
484
|
|
485
485
|
- name: Submit PR to Gerrit (with explicit overrides)
|
486
486
|
id: g2g
|
487
|
-
uses:
|
487
|
+
uses: lfreleng-actions/github2gerrit-action@main
|
488
488
|
with:
|
489
489
|
# Behavior
|
490
490
|
SUBMIT_SINGLE_COMMITS: "false"
|
@@ -737,7 +737,7 @@ For CI/CD pipelines (like GitHub Actions), use `uvx` to install and run without
|
|
737
737
|
uvx github2gerrit <PR_URL> --dry-run
|
738
738
|
|
739
739
|
# Install from a specific version or source
|
740
|
-
uvx --from git+https://github.com/
|
740
|
+
uvx --from git+https://github.com/lfreleng-actions/github2gerrit-action@main github2gerrit <PR_URL>
|
741
741
|
|
742
742
|
# Run with specific Python version
|
743
743
|
uvx --python 3.11 github2gerrit <PR_URL>
|
Binary file
|
@@ -359,15 +359,21 @@ def main(
|
|
359
359
|
# URL mode handling
|
360
360
|
if target_url:
|
361
361
|
org, repo, pr = _parse_github_target(target_url)
|
362
|
+
log.debug("Parsed GitHub URL: org=%s, repo=%s, pr=%s", org, repo, pr)
|
362
363
|
if org:
|
363
364
|
os.environ["ORGANIZATION"] = org
|
365
|
+
log.debug("Set ORGANIZATION=%s", org)
|
364
366
|
if org and repo:
|
365
|
-
|
367
|
+
github_repo = f"{org}/{repo}"
|
368
|
+
os.environ["GITHUB_REPOSITORY"] = github_repo
|
369
|
+
log.debug("Set GITHUB_REPOSITORY=%s", github_repo)
|
366
370
|
if pr:
|
367
371
|
os.environ["PR_NUMBER"] = str(pr)
|
368
372
|
os.environ["SYNC_ALL_OPEN_PRS"] = "false"
|
373
|
+
log.debug("Set PR_NUMBER=%s", pr)
|
369
374
|
else:
|
370
375
|
os.environ["SYNC_ALL_OPEN_PRS"] = "true"
|
376
|
+
log.debug("Set SYNC_ALL_OPEN_PRS=true")
|
371
377
|
os.environ["G2G_TARGET_URL"] = "1"
|
372
378
|
# Debug: Show environment at CLI startup
|
373
379
|
log.debug("CLI startup environment check:")
|
@@ -131,6 +131,22 @@ def _coerce_value(raw: str) -> str:
|
|
131
131
|
# like SSH keys or known_hosts entries can be specified inline using
|
132
132
|
# '\n' or '\r\n' in configuration files.
|
133
133
|
normalized_newlines = unquoted.replace("\\r\\n", "\n").replace("\\n", "\n").replace("\r\n", "\n")
|
134
|
+
|
135
|
+
# Additional sanitization for SSH private keys
|
136
|
+
if ("-----BEGIN" in normalized_newlines and "PRIVATE KEY-----" in normalized_newlines) or (
|
137
|
+
"ssh-" in normalized_newlines.lower() and "key" in normalized_newlines.lower()
|
138
|
+
):
|
139
|
+
# Clean up SSH key formatting: remove extra whitespace, normalize line endings
|
140
|
+
lines = normalized_newlines.split("\n")
|
141
|
+
sanitized_lines = []
|
142
|
+
for line in lines:
|
143
|
+
cleaned = line.strip()
|
144
|
+
if cleaned:
|
145
|
+
# Remove any stray quotes that might have been embedded in the key content
|
146
|
+
cleaned = cleaned.replace('"', "").replace("'", "")
|
147
|
+
sanitized_lines.append(cleaned)
|
148
|
+
normalized_newlines = "\n".join(sanitized_lines)
|
149
|
+
|
134
150
|
b = _normalize_bool_like(normalized_newlines)
|
135
151
|
return b if b is not None else normalized_newlines
|
136
152
|
|
@@ -149,7 +165,7 @@ def _select_section(
|
|
149
165
|
|
150
166
|
def _load_ini(path: Path) -> configparser.RawConfigParser:
|
151
167
|
cp = configparser.RawConfigParser()
|
152
|
-
# Preserve option case; mypy requires a cast for attribute
|
168
|
+
# Preserve option case; mypy requires a cast for attribute requirement
|
153
169
|
cast(Any, cp).optionxform = str
|
154
170
|
try:
|
155
171
|
with path.open("r", encoding="utf-8") as fh:
|
@@ -162,6 +178,9 @@ def _load_ini(path: Path) -> configparser.RawConfigParser:
|
|
162
178
|
# We collapse these into a single line with '\n' escapes so that
|
163
179
|
# configparser can ingest them reliably; later, _coerce_value()
|
164
180
|
# converts the escapes back to real newlines.
|
181
|
+
#
|
182
|
+
# We also handle SSH private keys and other multi-line values that
|
183
|
+
# might have formatting inconsistencies by sanitizing them.
|
165
184
|
lines = raw_text.splitlines()
|
166
185
|
out_lines: list[str] = []
|
167
186
|
i = 0
|
@@ -171,6 +190,8 @@ def _load_ini(path: Path) -> configparser.RawConfigParser:
|
|
171
190
|
if eq_idx != -1:
|
172
191
|
left = line[: eq_idx + 1]
|
173
192
|
rhs = line[eq_idx + 1 :].strip()
|
193
|
+
|
194
|
+
# Handle standard multi-line quoted values: key = "
|
174
195
|
if rhs == '"':
|
175
196
|
i += 1
|
176
197
|
block: list[str] = []
|
@@ -187,10 +208,64 @@ def _load_ini(path: Path) -> configparser.RawConfigParser:
|
|
187
208
|
else:
|
188
209
|
# No closing quote found; fall through
|
189
210
|
# and keep original line
|
211
|
+
log.debug("Multi-line quote not properly closed for line: %s", line[:50])
|
190
212
|
out_lines.append(line)
|
191
213
|
continue
|
214
|
+
|
215
|
+
# Handle SSH private keys and other values that start with a quote
|
216
|
+
# but contain embedded content that might confuse configparser
|
217
|
+
elif rhs.startswith('"') and not rhs.endswith('"'):
|
218
|
+
# This looks like a multi-line value that starts on the same line
|
219
|
+
# Collect all content until we find a line ending with a quote
|
220
|
+
content_lines = [rhs[1:]] # Remove opening quote
|
221
|
+
i += 1
|
222
|
+
|
223
|
+
while i < len(lines):
|
224
|
+
current_line = lines[i]
|
225
|
+
if current_line.strip().endswith('"') and not current_line.strip().endswith('\\"'):
|
226
|
+
# Found closing quote - remove it and add final line
|
227
|
+
final_content = current_line.rstrip()
|
228
|
+
if final_content.endswith('"'):
|
229
|
+
final_content = final_content[:-1]
|
230
|
+
if final_content: # Only add if there's content after removing quote
|
231
|
+
content_lines.append(final_content)
|
232
|
+
break
|
233
|
+
else:
|
234
|
+
content_lines.append(current_line)
|
235
|
+
i += 1
|
236
|
+
|
237
|
+
# Join all content and sanitize for SSH keys
|
238
|
+
full_content = "\\n".join(content_lines)
|
239
|
+
|
240
|
+
# Special handling for SSH private keys - remove extra whitespace and line breaks
|
241
|
+
key_name = left.split("=")[0].strip().upper()
|
242
|
+
if "SSH" in key_name and "KEY" in key_name:
|
243
|
+
# For SSH keys, clean up base64 content by removing whitespace within lines
|
244
|
+
sanitized_lines = []
|
245
|
+
for content_line in content_lines:
|
246
|
+
cleaned = content_line.strip()
|
247
|
+
# Preserve SSH key headers/footers but clean base64 content
|
248
|
+
if cleaned.startswith("-----") or not cleaned:
|
249
|
+
sanitized_lines.append(cleaned)
|
250
|
+
else:
|
251
|
+
# Remove any embedded quotes and whitespace from base64 content
|
252
|
+
cleaned = cleaned.replace('"', "").replace("'", "").strip()
|
253
|
+
if cleaned:
|
254
|
+
sanitized_lines.append(cleaned)
|
255
|
+
full_content = "\\n".join(sanitized_lines)
|
256
|
+
|
257
|
+
log.debug(
|
258
|
+
"Processed multi-line value for key %s (length: %d)",
|
259
|
+
left.split("=")[0].strip(),
|
260
|
+
len(full_content),
|
261
|
+
)
|
262
|
+
out_lines.append(f'{left} "{full_content}"')
|
263
|
+
i += 1
|
264
|
+
continue
|
265
|
+
|
192
266
|
out_lines.append(line)
|
193
267
|
i += 1
|
268
|
+
|
194
269
|
preprocessed = "\n".join(out_lines) + ("\n" if out_lines else "")
|
195
270
|
cp.read_string(preprocessed)
|
196
271
|
except FileNotFoundError:
|
@@ -272,6 +347,8 @@ def load_org_config(
|
|
272
347
|
|
273
348
|
# Report unknown configuration keys to help users catch typos
|
274
349
|
unknown_keys = set(normalized.keys()) - KNOWN_KEYS
|
350
|
+
log.debug("All parsed keys from config: %s", sorted(normalized.keys()))
|
351
|
+
log.debug("Known keys: %s", sorted(KNOWN_KEYS))
|
275
352
|
if unknown_keys:
|
276
353
|
log.warning(
|
277
354
|
"Unknown configuration keys found in [%s]: %s. "
|
@@ -171,7 +171,9 @@ def build_client(token: str | None = None) -> GhClient:
|
|
171
171
|
def get_repo_from_env(client: GhClient) -> GhRepository:
|
172
172
|
"""Return the repository object based on GITHUB_REPOSITORY."""
|
173
173
|
full = _getenv_str("GITHUB_REPOSITORY")
|
174
|
+
log.debug("GITHUB_REPOSITORY environment variable: '%s'", full)
|
174
175
|
if not full or "/" not in full:
|
176
|
+
log.error("Invalid GITHUB_REPOSITORY: '%s' (expected format: 'owner/repo')", full)
|
175
177
|
raise ValueError(_MSG_BAD_GITHUB_REPOSITORY)
|
176
178
|
repo = client.get_repo(full)
|
177
179
|
return repo
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: github2gerrit
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.9
|
4
4
|
Summary: Submit a GitHub pull request to a Gerrit repository.
|
5
5
|
Author-email: Matthew Watkins <mwatkins@linuxfoundation.org>
|
6
6
|
License-Expression: Apache-2.0
|
@@ -297,7 +297,7 @@ jobs:
|
|
297
297
|
steps:
|
298
298
|
- name: Submit PR to Gerrit
|
299
299
|
id: g2g
|
300
|
-
uses:
|
300
|
+
uses: lfreleng-actions/github2gerrit-action@main
|
301
301
|
with:
|
302
302
|
SUBMIT_SINGLE_COMMITS: "false"
|
303
303
|
USE_PR_AS_COMMIT: "false"
|
@@ -343,7 +343,7 @@ uv run github2gerrit
|
|
343
343
|
uvx github2gerrit https://github.com/owner/repo/pull/123
|
344
344
|
|
345
345
|
# Install from specific version/source
|
346
|
-
uvx --from git+https://github.com/
|
346
|
+
uvx --from git+https://github.com/lfreleng-actions/github2gerrit-action@main github2gerrit https://github.com/owner/repo/pull/123
|
347
347
|
```
|
348
348
|
|
349
349
|
### Available Options
|
@@ -524,7 +524,7 @@ jobs:
|
|
524
524
|
|
525
525
|
- name: Submit PR to Gerrit (with explicit overrides)
|
526
526
|
id: g2g
|
527
|
-
uses:
|
527
|
+
uses: lfreleng-actions/github2gerrit-action@main
|
528
528
|
with:
|
529
529
|
# Behavior
|
530
530
|
SUBMIT_SINGLE_COMMITS: "false"
|
@@ -777,7 +777,7 @@ For CI/CD pipelines (like GitHub Actions), use `uvx` to install and run without
|
|
777
777
|
uvx github2gerrit <PR_URL> --dry-run
|
778
778
|
|
779
779
|
# Install from a specific version or source
|
780
|
-
uvx --from git+https://github.com/
|
780
|
+
uvx --from git+https://github.com/lfreleng-actions/github2gerrit-action@main github2gerrit <PR_URL>
|
781
781
|
|
782
782
|
# Run with specific Python version
|
783
783
|
uvx --python 3.11 github2gerrit <PR_URL>
|
@@ -24,6 +24,7 @@ uv.lock
|
|
24
24
|
.github/workflows/sha-pinned-actions.yaml
|
25
25
|
.github/workflows/testing.yaml
|
26
26
|
LICENSES/Apache-2.0.txt
|
27
|
+
docs/github2gerrit_token_permissions_classic.png
|
27
28
|
src/github2gerrit/__init__.py
|
28
29
|
src/github2gerrit/cli.py
|
29
30
|
src/github2gerrit/commit_normalization.py
|
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
|
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
|
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
|
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
|