Skip to content

Commit

Permalink
Merge pull request #539 from NASA-IMPACT/push-collections-to-github-s…
Browse files Browse the repository at this point in the history
…cript

Added a script to push collections that have been curated to GitHub
  • Loading branch information
bishwaspraveen authored Jan 24, 2024
2 parents a34fd59 + 60615dc commit 7c8821b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scripts/push_curated_collections_to_github.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from sde_collections.models.collection import Collection
from sde_collections.models.collection_choice_fields import WorkflowStatusChoices
from sde_collections.utils.github_helper import GitHubHandler


def push_curated_collections_to_github():
# Filter collections with a specific workflow status (CURATED)
collections = Collection.objects.filter(
workflow_status=WorkflowStatusChoices.CURATED
)

# Initialize the GitHub handler and push collections
github_handler = GitHubHandler(collections)
github_handler.push_to_github()
print(
"Curated collections with a workflow status of CURATED have been pushed to GitHub."
)


if __name__ == "__main__":
push_curated_collections_to_github()

0 comments on commit 7c8821b

Please sign in to comment.