From 0ba189615cc684803c08d210e73396e40c5425bb Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD <90267658+Loup-Garou911XD@users.noreply.github.com> Date: Wed, 10 Dec 2025 21:09:38 +0530 Subject: [PATCH] fix --- .github/workflows/ci.yml | 11 ++++++----- test/auto_apply_plugin_metadata.py | 2 ++ test/versioning_tools.py | 8 ++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fc19ef..c3f3541 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/test/auto_apply_plugin_metadata.py b/test/auto_apply_plugin_metadata.py index 9e94659..272ebc8 100644 --- a/test/auto_apply_plugin_metadata.py +++ b/test/auto_apply_plugin_metadata.py @@ -7,6 +7,8 @@ import versioning_tools DEBUG = True +print("DOES THIS RUN AUTO APPLY PLUGIN METADATA?") + def debug_print(*args, **kwargs): if DEBUG: diff --git a/test/versioning_tools.py b/test/versioning_tools.py index b2facfd..6d75da9 100644 --- a/test/versioning_tools.py +++ b/test/versioning_tools.py @@ -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))