]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Support version specifiers in GH action (#3265)
authorJakub Kuczys <me@jacken.men>
Fri, 23 Sep 2022 03:23:35 +0000 (05:23 +0200)
committerGitHub <noreply@github.com>
Fri, 23 Sep 2022 03:23:35 +0000 (20:23 -0700)
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
CHANGES.md
action/main.py
docs/integrations/github_actions.md

index 0fa80ad8124fffddd3de77b530042244cff29482..67d007c21ae39c195e19cb6daf3cdb8f4c6d54e8 100644 (file)
@@ -47,6 +47,9 @@
 
 <!-- For example, Docker, GitHub Actions, pre-commit, editors -->
 
+- Update GitHub Action to support use of version specifiers (e.g. `<23`) for Black
+  version (#3265)
+
 ### Documentation
 
 <!-- Major changes to documentation and policies. Small docs changes
index cd920f5fe0ddd09c1d0dc5712795262f65dd1968..03228cb13e8134ffbcbd439d9dc37906daa45e27 100644 (file)
@@ -14,9 +14,10 @@ VERSION = os.getenv("INPUT_VERSION", default="")
 
 run([sys.executable, "-m", "venv", str(ENV_PATH)], check=True)
 
-req = "black[colorama]"
-if VERSION:
-    req += f"=={VERSION}"
+version_specifier = VERSION
+if VERSION and VERSION[0] in "0123456789":
+    version_specifier = f"=={VERSION}"
+req = f"black[colorama]{version_specifier}"
 pip_proc = run(
     [str(ENV_BIN / "python"), "-m", "pip", "install", req],
     stdout=PIPE,
index c9697cc05dee89420cfbbc9d302d74246a84f9e9..d77b969367897f155671bd38941e6f2db117b493 100644 (file)
@@ -32,9 +32,12 @@ We recommend the use of the `@stable` tag, but per version tags also exist if yo
 that. Note that the action's version you select is independent of the version of _Black_
 the action will use.
 
-The version of _Black_ the action will use can be configured via `version`. The action
-defaults to the latest release available on PyPI. Only versions available from PyPI are
-supported, so no commit SHAs or branch names.
+The version of _Black_ the action will use can be configured via `version`. This can be
+any
+[valid version specifier](https://packaging.python.org/en/latest/glossary/#term-Version-Specifier)
+or just the version number if you want an exact version. The action defaults to the
+latest release available on PyPI. Only versions available from PyPI are supported, so no
+commit SHAs or branch names.
 
 You can also configure the arguments passed to _Black_ via `options` (defaults to
 `'--check --diff'`) and `src` (default is `'.'`)
@@ -48,3 +51,15 @@ Here's an example configuration:
     src: "./src"
     version: "21.5b1"
 ```
+
+If you want to match versions covered by Black's
+[stability policy](labels/stability-policy), you can use the compatible release operator
+(`~=`):
+
+```yaml
+- uses: psf/black@stable
+  with:
+    options: "--check --verbose"
+    src: "./src"
+    version: "~= 22.0"
+```