Skip to content

Commit 0d0d52c

Browse files
committed
Fix pull request file path issue
1 parent 7fc5a29 commit 0d0d52c

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

main.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111
logger,
1212
)
1313
from src.exceptions import GithubPRFailedException
14-
from src.github_api_client import GithubAPIClient, RHDHPluginUpdaterConfig
14+
from src.github_api_client import GithubAPIClient
1515
from src.loader import RHDHPluginsConfigLoader
16-
from src.types import GithubPullRequestStrategy, RHDHPluginUpdate
16+
from src.types import (
17+
GithubPullRequestStrategy,
18+
RHDHPluginUpdate,
19+
RHDHPluginUpdaterConfig,
20+
)
1721
from src.updater import RHDHPluginConfigUpdater
1822
from src.utils import rhdh_plugin_needs_update
1923

@@ -31,6 +35,9 @@ def main():
3135
rhdh_config_loader = RHDHPluginsConfigLoader()
3236
rhdh_config_updater = RHDHPluginConfigUpdater()
3337
rhdh_plugins = rhdh_config_loader.load_rhdh_plugins()
38+
trimmed_file_path = DYNAMIC_PLUGINS_CONFIG_YAML_FILE_PATH.replace(
39+
RHDHPluginUpdaterConfig.GH_RUNNER_PREFIX, ""
40+
)
3441

3542
logger.info(f"found {len(rhdh_plugins)} RHDH plugins to check for updates")
3643

@@ -82,7 +89,7 @@ def main():
8289

8390
pr_url = gh_api_client.create_pull_request(
8491
repo_full_name=GITHUB_REPOSITORY,
85-
file_path=DYNAMIC_PLUGINS_CONFIG_YAML_FILE_PATH,
92+
file_path=trimmed_file_path,
8693
new_content=updated_yaml,
8794
branch_name=RHDHPluginUpdaterConfig.GH_PR_BRANCH_NAME_BASE.format(
8895
plugin_name=plugin.plugin_name, latest_version=latest_version
@@ -125,7 +132,7 @@ def main():
125132

126133
pr_url = gh_api_client.create_pull_request(
127134
repo_full_name=GITHUB_REPOSITORY,
128-
file_path=DYNAMIC_PLUGINS_CONFIG_YAML_FILE_PATH,
135+
file_path=trimmed_file_path,
129136
new_content=updated_yaml,
130137
branch_name=RHDHPluginUpdaterConfig.GH_BULK_PR_BRANCH_NAME_BASE,
131138
pr_title=RHDHPluginUpdaterConfig.GH_BULK_PR_TITLE_BASE.format(

src/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class RHDHPluginUpdaterConfig:
5353
GH_PACKAGE_TAG_PREFIX = "next__"
5454
GH_PACKAGES_BASE_URL = "https://api.github.com/orgs/{org}/packages"
5555
GH_PACKAGES_VERSION_BASE_URL = "https://api.github.com/orgs/{org}/packages/{package_type}/{package_name}/versions"
56+
GH_RUNNER_PREFIX = "/github/workspace/"
5657
GH_CR_REGISTRY_PREFIX = (
5758
"oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/"
5859
)

0 commit comments

Comments
 (0)