Skip to content

Commit

Permalink
Workflow: Fix update date
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Nov 2, 2024
1 parent 3f24759 commit bc5ab81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit bc5ab81

Please sign in to comment.