From 13c0825a3882d12925423fd7756f910892d9cf1e Mon Sep 17 00:00:00 2001 From: Rafal Chlodnicki Date: Mon, 22 Jan 2024 07:27:29 +0100 Subject: [PATCH] chore(ci): fix workflow script --- .github/workflows/schema.yml | 7 ++++++- scripts/update_schema.py | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/schema.yml b/.github/workflows/schema.yml index ef699e4..0a2f953 100644 --- a/.github/workflows/schema.yml +++ b/.github/workflows/schema.yml @@ -26,7 +26,12 @@ jobs: - name: Update schema id: update-schema - run: echo "OUTPUT=$(make update-schema)" >> "$GITHUB_OUTPUT" + run: | + { + echo 'OUTPUT<> "$GITHUB_OUTPUT" - name: Check for modified files id: git-check diff --git a/scripts/update_schema.py b/scripts/update_schema.py index b5fa39a..d217fb3 100755 --- a/scripts/update_schema.py +++ b/scripts/update_schema.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + from __future__ import annotations import json @@ -37,12 +39,12 @@ def main() -> None: new_schema_keys = sorted(update_schema(sublime_package_schema_json, pyrightconfig_schema_json)) after = json.dumps(sublime_package_schema_json, **json_dump_kwargs) if before != after: - SUBLIME_PACKAGE_JSON_PATH.write_text(after, encoding="utf-8") + SUBLIME_PACKAGE_JSON_PATH.write_text(f"{after}\n", encoding="utf-8") print("sublime-package.json schema updated.") else: print("No updates done to sublime-package.json.") if new_schema_keys: - new_schema_keys_text = "\n - ".join(new_schema_keys) + new_schema_keys_text = map(lambda k: f"\n - {k}", new_schema_keys) print(f"\nNew keys found in the latest pyrightconfig.json schema: {new_schema_keys_text}\n\n") print("Ensure that those are added to the sublime-package.json manually, if relevant.")