This commit is contained in:
neoarz 2025-04-14 22:49:17 -04:00
parent 3336bbf1a4
commit 702a10795b
2 changed files with 40 additions and 0 deletions

22
.github/workflows/updatesource.yml vendored Normal file
View file

@ -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

18
update_json.py Normal file
View file

@ -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