Skip to content

Commit e30cdd7

Browse files
authored
Merge branch 'main' into Use-.ref-in-version_to_download-if-force_branch-is-set
2 parents d33e9be + f5426ae commit e30cdd7

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

action/action.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ async def preflight():
135135
if ref.startswith("refs/tags/"):
136136
ref = ref.split("/")[-1]
137137

138-
LOGGER.info(f"Category: {category}")
139-
LOGGER.info(f"Repository: {repository}{f'@{ref}' if ref else ''}")
140-
141138
if TOKEN is None:
142139
error("No GitHub token found, use env GITHUB_TOKEN to set this.")
143140

@@ -150,10 +147,16 @@ async def preflight():
150147
if category not in CATEGORIES:
151148
error(f"Category {category} is not valid.")
152149

150+
if (repository_ref := os.getenv("REPOSITORY_REF")) is not None:
151+
ref = repository_ref
152+
153153
if ref is None and GITHUB_REPOSITORY != HacsGitHubRepo.DEFAULT:
154154
repo = await hacs.githubapi.repos.get(repository)
155155
ref = repo.data.default_branch
156156

157+
LOGGER.info(f"Category: {category}")
158+
LOGGER.info(f"Repository: {repository}{f'@{ref}' if ref else ''}")
159+
157160
await validate_repository(hacs, repository, category, ref)
158161

159162

0 commit comments

Comments
 (0)