Skip to content

Commit c077840

Browse files
authored
Merge pull request #3653 from OpenNeuroOrg/github-private-sibling-push-fix
fix(worker): Don't push private datasets to GitHub
2 parents 871f977 + fc04ed9 commit c077840

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

services/datalad/datalad_service/tasks/publish.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ async def export_dataset(
131131
"""
132132
if is_git_annex_remote(dataset_path, get_s3_remote()):
133133
dataset_id = os.path.basename(dataset_path)
134+
public_dataset = is_public_dataset(dataset_id)
134135
repo = pygit2.Repository(dataset_path)
135136
tags = sorted(git_tag(repo), key=lambda tag: tag.name)
136137
# Update configuration for the remote
@@ -139,11 +140,11 @@ async def export_dataset(
139140
if tags:
140141
new_tag = tags[-1].name
141142
await s3_export(dataset_path, get_s3_remote(), new_tag)
142-
if not is_public_dataset(dataset_id):
143+
if not public_dataset:
143144
await set_s3_access_tag(dataset_id, 'private')
144145
await s3_backup_push(dataset_path)
145146
# Once all S3 tags are exported, update GitHub
146-
if github_enabled:
147+
if github_enabled and public_dataset:
147148
# Perform all GitHub export steps
148149
github_export(dataset_id, dataset_path, new_tag)
149150
# Drop cache once all exports are complete

0 commit comments

Comments
 (0)