From ead6a29d869e18ca8de4447dc1db474b36eb5b6e Mon Sep 17 00:00:00 2001 From: ckie Date: Fri, 24 Dec 2021 14:27:53 +0200 Subject: [PATCH] update_flake_lock.py: skip if not github --- .github/workflows/update_flake_lock.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/update_flake_lock.py b/.github/workflows/update_flake_lock.py index 959beda..73d8842 100755 --- a/.github/workflows/update_flake_lock.py +++ b/.github/workflows/update_flake_lock.py @@ -38,6 +38,10 @@ class FlakeLock: def inputs(self): return self._lock["nodes"]["root"]["inputs"] + def is_github(self, flake_input): + n = self._lock["nodes"][flake_input] + return n.type == "github"; + def get_input(self, flake_input): n = self._lock["nodes"][flake_input] repo_id = f"{n['locked']['owner']}/{n['locked']['repo']}" @@ -131,6 +135,10 @@ def main(): for l in diff: print(l, end="") + if not lock.is_github(flake_input): + print(f"[{flake_input}] Non-github repositories unsupported") + continue + old = lock.get_input(flake_input) new = FlakeLock(github, updated_lock_contents).get_input(flake_input)