From c36e468794f9256d5e922c399240d49782ba04f1 Mon Sep 17 00:00:00 2001 From: Christian Proud Date: Wed, 9 Aug 2023 02:12:05 +0800 Subject: [PATCH] Remove ENV_PATH on Black action completion (#3759) --- CHANGES.md | 2 ++ action/main.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index d084498..8bf4188 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -50,6 +50,8 @@ [official pre-commit mirror](https://github.com/psf/black-pre-commit-mirror). Swapping `https://github.com/psf/black` to `https://github.com/psf/black-pre-commit-mirror` in your `.pre-commit-config.yaml` will make Black about 2x faster (#3828) +- The `.black.env` folder specified by `ENV_PATH` will now be removed on the completion + of the GitHub Action. (#3759) ### Documentation diff --git a/action/main.py b/action/main.py index 1911cfd..c0af393 100644 --- a/action/main.py +++ b/action/main.py @@ -1,5 +1,6 @@ import os import shlex +import shutil import sys from pathlib import Path from subprocess import PIPE, STDOUT, run @@ -73,5 +74,6 @@ else: stderr=STDOUT, encoding="utf-8", ) +shutil.rmtree(ENV_PATH, ignore_errors=True) print(proc.stdout) sys.exit(proc.returncode) -- 2.39.5