From f8e87467b5c0346ab4a6720a5ba8a0c0140ef7e6 Mon Sep 17 00:00:00 2001 From: Brendon Smith Date: Sat, 1 Jun 2024 17:08:20 -0400 Subject: [PATCH] Dump action as JSON --- action.yml | 3 +-- create-docker-action.py | 7 ++----- requirements/github-actions.in | 2 -- requirements/github-actions.txt | 8 -------- 4 files changed, 3 insertions(+), 17 deletions(-) delete mode 100644 requirements/github-actions.in delete mode 100644 requirements/github-actions.txt diff --git a/action.yml b/action.yml index 9c34ad7..486e39d 100644 --- a/action.yml +++ b/action.yml @@ -130,8 +130,7 @@ runs: - name: Create Docker container action run: | # Create Docker container action - python -m pip install -r requirements/github-actions.txt - python create-docker-action.py ${{ steps.set-image.outputs.image }} + python create-docker-action.py env: EVENT: ${{ github.event_name }} REF: ${{ steps.set-repo-and-ref.outputs.ref }} diff --git a/create-docker-action.py b/create-docker-action.py index bc2e005..dc36155 100644 --- a/create-docker-action.py +++ b/create-docker-action.py @@ -1,8 +1,7 @@ +import json import os import pathlib -import yaml - DESCRIPTION = 'description' REQUIRED = 'required' @@ -83,6 +82,4 @@ action = { action_path = pathlib.Path('.github/actions/run-docker-container/action.yml') action_path.parent.mkdir(parents=True, exist_ok=True) - -with action_path.open(mode='w', encoding='utf-8') as file: - yaml.dump(action, file, allow_unicode=True, sort_keys=False) +action_path.write_text(json.dumps(action, ensure_ascii=False), encoding='utf-8') diff --git a/requirements/github-actions.in b/requirements/github-actions.in deleted file mode 100644 index 2314722..0000000 --- a/requirements/github-actions.in +++ /dev/null @@ -1,2 +0,0 @@ -# NOTE: used by create-docker-action.py -pyyaml diff --git a/requirements/github-actions.txt b/requirements/github-actions.txt deleted file mode 100644 index 0f1caa2..0000000 --- a/requirements/github-actions.txt +++ /dev/null @@ -1,8 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --allow-unsafe --config=../.pip-tools.toml --output-file=github-actions.txt --strip-extras github-actions.in -# -pyyaml==6.0.1 - # via -r github-actions.in