Skip to content

Commit 31925e8

Browse files
committed
define repo config filepath based on source forge
1
1 parent 53b83b8 commit 31925e8

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/hubcast/clients/github/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ async def get_repo_config(self):
101101
gh = gh_aiohttp.GitHubAPI(session, self.requester, oauth_token=gh_token)
102102

103103
# get the contents of the repository hubcast.yml file
104+
# the forge is github so the config will be under .github
104105
url = f"/repos/{self.repo_owner}/{self.repo_name}/contents/.github/hubcast.yml"
105106
# get raw contents rather than base64 encoded text
106107
config_str = await gh.getitem(url, accept="application/vnd.github.raw")

src/hubcast/clients/gitlab/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ async def get_repo_config(self):
180180
session, self.requester, access_token=gl_token, url=self.instance_url
181181
)
182182

183-
filepath = urllib.parse.quote_plus(".github/hubcast.yml")
183+
# get the contents of the repository hubcast.yml file
184+
# the forge is github so the config will be under .github
185+
filepath = urllib.parse.quote_plus(".gitlab/hubcast.yml")
184186
url = f"/projects/{self.repo_id}/repository/files/{filepath}/raw"
185187
config_str = await gl.getitem(url)
186188

src/hubcast/web/github/routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ async def sync_pr(pull_request, gh, gl, gl_user):
158158
else:
159159
target_ref = f"refs/heads/{pull_request['head']['ref']}"
160160

161-
# get the repository configuration from .github/hubcast.yml
161+
# get the repository configuration
162162
repo_config = await get_repo_config(gh, src_fullname)
163163

164164
dest_fullname = f"{repo_config.dest_org}/{repo_config.dest_name}"
@@ -230,7 +230,7 @@ async def remove_pr(event, gh, gl, gl_user, *args, **kwargs):
230230
pull_request_id = pull_request["number"]
231231
target_ref = f"refs/heads/pr-{pull_request_id}"
232232

233-
# get the repository configuration from .github/hubcast.yml
233+
# get the repository configuration
234234
repo_config = await get_repo_config(gh, src_fullname)
235235

236236
dest_fullname = f"{repo_config.dest_org}/{repo_config.dest_name}"

0 commit comments

Comments
 (0)