This commit is contained in:
Loup-Garou911XD 2025-12-10 21:09:38 +05:30
parent 14ad3668b3
commit 0ba189615c
3 changed files with 12 additions and 9 deletions

View file

@ -2,11 +2,11 @@ name: CI
# WORD OF CAUTION:
# TO anyone modifying this
# Things will break if you modify this
# Things will break if you modify this
# without understanding how it works
# A simple flow of this file:
# Apply AutoPEP8 → Apply Plugin Metadata → CRITICAL COMMIT (format + plugin meta)
# Apply AutoPEP8 → Apply Plugin Metadata → CRITICAL COMMIT (format + plugin meta)
# ← ← ← ← ← ↵
# ↪ Apply Version Metadata → Commit (version meta) → Tests
@ -24,6 +24,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python
uses: actions/setup-python@v6
@ -42,10 +43,10 @@ jobs:
- name: Apply Plugin Metadata
if: github.event_name == 'pull_request_target'
# should this only be run on pull_request_target and not pushes??
env:
GH_TOKEN: ${{ github.token }}
run: |
LAST_COMMIT_HASH=$(git log --pretty=format:'%H' -n 1)
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r "$LAST_COMMIT_HASH")
CHANGED_FILES=$(gh api "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" --jq '.[].filename')
python test/auto_apply_plugin_metadata.py "$CHANGED_FILES"
# This is a CRITICAL COMMIT for the next step

View file

@ -7,6 +7,8 @@ import versioning_tools
DEBUG = True
print("DOES THIS RUN AUTO APPLY PLUGIN METADATA?")
def debug_print(*args, **kwargs):
if DEBUG:

View file

@ -1,5 +1,5 @@
import sys
from get_latest import get_latest_version
from get_latest import get_latest_plugman_version
"""if called directly from command line, it will check if given version is lower
than latest version in index.json"""
@ -17,9 +17,9 @@ def semantic_to_str(semantic_version: str):
return out
def version_is_lower(version: str):
def plugman_version_is_lower_than(version: str):
"""Check if given version is lower than the latest entry in index.json"""
latest = semantic_to_str(get_latest_version())
latest = semantic_to_str(get_latest_plugman_version())
version = semantic_to_str(version)
if latest > version:
return True
@ -33,5 +33,5 @@ if __name__ == "__main__":
sys.exit(1)
version = sys.argv[1].replace("v", "", 1)
out = version_is_lower(version)
out = plugman_version_is_lower_than(version)
print(int(out))