From 5c54c95befcdda8803c3393ed2b16e44db6177d9 Mon Sep 17 00:00:00 2001 From: Rudra Pratap Singh Date: Thu, 20 Jun 2024 20:36:16 +0530 Subject: [PATCH] [Extended] update-automation to rockcraft.yaml (#635) * Extended update-automation for rockcraft.yaml * correct nested try-catch in updatesnapyaml and correct if-else block in action.yaml --- action.yml | 4 +++- updatesnap/updatesnapyaml.py | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 32a3441..64aa6dc 100644 --- a/action.yml +++ b/action.yml @@ -53,7 +53,9 @@ runs: fi if [ -f output_file ]; then echo "IS_CHANGE=true" >> $GITHUB_ENV - if [ -d snap ]; then + if [ -f rockcraft.yaml ]; then + mv output_file rockcraft.yaml + elif [ -d snap ]; then mv output_file snap/snapcraft.yaml else mv output_file snapcraft.yaml diff --git a/updatesnap/updatesnapyaml.py b/updatesnap/updatesnapyaml.py index 1ada5cd..755c72d 100755 --- a/updatesnap/updatesnapyaml.py +++ b/updatesnap/updatesnapyaml.py @@ -54,6 +54,12 @@ def get_yaml_file(self, project_url): data = self._github.get_file(project_url, yaml_path) except (ValueError, ConnectionError): data = None + if not data: + yaml_path = 'rockcraft.yaml' + try: + data = self._github.get_file(project_url, yaml_path) + except (ValueError, ConnectionError): + data = None return data