From 702a10795b84a8a29156ee28dc41db9cb8a35b0c Mon Sep 17 00:00:00 2001 From: neoarz Date: Mon, 14 Apr 2025 22:49:17 -0400 Subject: [PATCH] start --- .github/workflows/updatesource.yml | 22 ++++++++++++++++++++++ update_json.py | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/updatesource.yml create mode 100644 update_json.py diff --git a/.github/workflows/updatesource.yml b/.github/workflows/updatesource.yml new file mode 100644 index 0000000..4ad6ed6 --- /dev/null +++ b/.github/workflows/updatesource.yml @@ -0,0 +1,22 @@ +name: Update StikJIT Source + +on: + release: + types: [published] + workflow_dispatch: + +# Add permissions block to ensure the workflow can push changes +permissions: + contents: write + +jobs: + update-source: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: 0-Blu/StikJIT + ref: main + \ No newline at end of file diff --git a/update_json.py b/update_json.py new file mode 100644 index 0000000..b118a81 --- /dev/null +++ b/update_json.py @@ -0,0 +1,18 @@ +import json +import re +import requests +import os +import sys +from datetime import datetime + +def prepare_description(text): + text = re.sub('<[^<]+?>', '', text) # Remove HTML tags + text = re.sub(r'#{1,6}\s?', '', text) # Remove markdown header tags + text = re.sub(r'\*{2}', '', text) # Remove all occurrences of two consecutive asterisks + text = re.sub(r'(?<=\r|\n)-', '•', text) # Only replace - with • if it is preceded by \r or \n + text = re.sub(r'`', '"', text) # Replace ` with " + text = re.sub(r'\r\n\r\n', '\r \n', text) # Replace \r\n\r\n with \r \n (avoid incorrect display of the description regarding paragraphs) + return text + + +