From 6c36ce785be6ae34ff08fe6647fd44ad12e5564e Mon Sep 17 00:00:00 2001 From: LambdAurora Date: Tue, 3 Dec 2024 19:31:24 +0100 Subject: [PATCH] Fix Modrinth README syncing. --- .github/workflows/sync_readme.yml | 24 +++++++++++++++++++ .../main/kotlin/lambdynamiclights/Utils.kt | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/sync_readme.yml diff --git a/.github/workflows/sync_readme.yml b/.github/workflows/sync_readme.yml new file mode 100644 index 00000000..49510f24 --- /dev/null +++ b/.github/workflows/sync_readme.yml @@ -0,0 +1,24 @@ +name: "Sync README" + +on: workflow_dispatch + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: "Checkout" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: "Set up Java" + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: 21 + - name: "Set up Gradle" + uses: gradle/actions/setup-gradle@v3 + + - name: "Build with Gradle" + run: ./gradlew build modrinthSyncBody --parallel --stacktrace + env: + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} diff --git a/build_logic/src/main/kotlin/lambdynamiclights/Utils.kt b/build_logic/src/main/kotlin/lambdynamiclights/Utils.kt index 8522a5fb..e43d2032 100644 --- a/build_logic/src/main/kotlin/lambdynamiclights/Utils.kt +++ b/build_logic/src/main/kotlin/lambdynamiclights/Utils.kt @@ -4,7 +4,7 @@ import org.gradle.api.Project object Utils { fun parseReadme(project: Project): String { - val linkRegex = "!\\[([A-z_ ]+)]\\((assets\\/[A-z.\\/_]+)\\)" + val linkRegex = "!\\[(.+?)]\\((assets\\/[A-z.\\/_]+)\\)" var readme = project.rootProject.file("README.md").readText() val lines = readme.split("\n").toMutableList()