Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow: Fix update date #593

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions github_app_geo_project/module/workflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@ async def process(

else:
_LOGGER.debug("No SECURITY.md file in the repository, apply on default branch")
stabilization_branches = [repo.default_branch]

for key in list(repo_data.keys()):
if key not in stabilization_branches or key == "updated":
if key not in stabilization_branches and key != "updated":
del repo_data[key]

head_branch = context.event_data.get("workflow_run", {}).get("head_branch")
Expand All @@ -96,7 +95,7 @@ async def process(
del branch_data[workflow_name]
if not branch_data:
del repo_data[head_branch]
if not repo_data:
if repo_data.keys() == {"updated"}:
del context.transversal_status[
context.github_project.owner + "/" + context.github_project.repository
]
Expand Down
3 changes: 2 additions & 1 deletion tests/test_module_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ async def test_process_failure() -> None:
# Call the process method
output = await workflow.process(context)

print(output)
assert "updated" in output.transversal_status["owner/repository"]
del output.transversal_status["owner/repository"]["updated"]
# Assert the expected output
assert output.transversal_status == {
"owner/repository": {
Expand Down