Repository: octue/twined

Issue:
Fix version consistency GitHub check so that it doesn't fail on main
The check currently fails on `main` and will fail on any single-word branch name.

Discussion:

Patch:
diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml
index 9582311..66a5e85 100644
--- a/.github/workflows/python-ci.yml
+++ b/.github/workflows/python-ci.yml
@@ -19,6 +19,7 @@ jobs:
 
   tests:
     runs-on: ubuntu-latest
+    if: "!contains(github.event.head_commit.message, '#skip_ci_tests')"
     env:
       USING_COVERAGE: '3.8'
     strategy:
diff --git a/.github/workflows/scripts/check-version-consistency.py b/.github/workflows/scripts/check-version-consistency.py
index 62ae22d..7ab9453 100644
--- a/.github/workflows/scripts/check-version-consistency.py
+++ b/.github/workflows/scripts/check-version-consistency.py
@@ -6,7 +6,7 @@ import sys
 PACKAGE_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
 
 
-class NotAVersionBranchException(Exception):
+class NotAReleaseBranchException(Exception):
     pass
 
 
@@ -33,6 +33,9 @@ def release_branch_version_matches_setup_version(setup_version, full_branch_name
     :raise NotAVersionBranchException:
     :return bool:
     """
+    if not full_branch_name.startswith("release"):
+        raise NotAReleaseBranchException(f"The branch is not a release branch: {full_branch_name!r}.")
+
     try:
         branch_type, branch_name = full_branch_name.split("/")
     except ValueError:
@@ -40,9 +43,6 @@ def release_branch_version_matches_setup_version(setup_version, full_branch_name
             f"The branch name must be in the form 'branch_type/branch_name'; received {full_branch_name!r}"
         )
 
-    if branch_type != "release":
-        raise NotAVersionBranchException(f"The branch is not a release branch: {full_branch_name!r}.")
-
     return branch_name == setup_version
 
 
@@ -63,6 +63,6 @@ if __name__ == "__main__":
         )
         sys.exit(1)
 
-    except NotAVersionBranchException as e:
+    except NotAReleaseBranchException as e:
         print(e.args[0])
         sys.exit(0)
diff --git a/setup.py b/setup.py
index 868653f..67c136d 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ with open("LICENSE") as f:
 
 setup(
     name="twined",
-    version="0.0.15",
+    version="0.0.16",
     py_modules=[],
     install_requires=["jsonschema ~= 3.2.0", "python-dotenv"],
     url="https://www.github.com/octue/twined",
diff --git a/twined/schema/children_schema.json b/twined/schema/children_schema.json
index 80b3778..4aa0368 100644
--- a/twined/schema/children_schema.json
+++ b/twined/schema/children_schema.json
@@ -28,12 +28,12 @@
                                 "description": "Name of the Google Cloud Platform (GCP) project the child exists in.",
                                 "type": "string"
                             },
-                            "credentials_environment_variable": {
-                                "description": "Name of environment variable containing either the absolute path to a Google Cloud Platform credentials JSON file or the JSON itself as a string.",
+                            "credentials_filename": {
+                                "description": "Absolute path to Google Cloud Platform credentials JSON file.",
                                 "type": "string"
                             }
                         },
-                        "required": ["name", "project_name", "credentials_environment_variable"]
+                        "required": ["name", "project_name", "credentials_filename"]
                     }
                 ]
             }


Test patch:
diff --git a/tests/test_children.py b/tests/test_children.py
index 5578244..ecacf56 100644
--- a/tests/test_children.py
+++ b/tests/test_children.py
@@ -64,7 +64,7 @@ class TestChildrenValidation(BaseTestCase):
                 "backend": {
                     "name": "GCPPubSubBackend",
                     "project_name": "my-project",
-                    "credentials_environment_variable": "GCP_SERVICE_ACCOUNT"
+                    "credentials_filename": "hello.json"
                 }
             }
         ]
@@ -119,7 +119,7 @@ class TestChildrenValidation(BaseTestCase):
                     "backend": {
                         "name": "GCPPubSubBackend",
                         "project_name": "my-project",
-                        "credentials_environment_variable": "GCP_SERVICE_ACCOUNT"
+                        "credentials_filename": "hello.json"
                     },
                     "some_extra_property": "should not be a problem if present"
                 }