From df494f14e21aee1543df1aa0a663be51b7e96a09 Mon Sep 17 00:00:00 2001 From: Alexander Green Date: Fri, 8 Mar 2024 17:29:14 +0100 Subject: [PATCH] Skip pdf option --- .github/workflows/build.yml | 10 +++++++++- .github/workflows/check.yml | 1 + scripts/pdf-name.py | 15 --------------- 3 files changed, 10 insertions(+), 16 deletions(-) delete mode 100644 scripts/pdf-name.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c45083c..51d059d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,8 +16,16 @@ jobs: - name: Static HTML run: | npx respec --localhost --src index.html --out ~/static/snapshot.html - - name: PDF + - name: Check config + id: config if: ${{ github.event_name == 'push'}} + run: | + echo "grep=false" >> $GITHUB_OUTPUT + if grep -q alternateFormats ./js/config.js; then + echo "grep=true" >> $GITHUB_OUTPUT + fi + - name: PDF + if: ${{ steps.config.outputs.grep == 'true' }} run: | cp ./js/config.js config.js echo "module.exports = { respecConfig };" >> config.js diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 8339ea2..250b4dc 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -38,5 +38,6 @@ jobs: --exclude '8080\/\S*\.pdf' --exclude 'upwork.com' --exclude 'sitearchief.nl' + --exclude 'opengis.net' --header 'user-agent:Curl' --ignore-fragments --one-page-only http://localhost:8080/snapshot.html --buffer-size 8192 diff --git a/scripts/pdf-name.py b/scripts/pdf-name.py deleted file mode 100644 index b34540b..0000000 --- a/scripts/pdf-name.py +++ /dev/null @@ -1,15 +0,0 @@ -import os -import sys - -f = open("./js/config.js", "r", encoding="utf-8") - -for line in f: - if (".pdf" in line) and ("//" not in line): - start = line.find("\"") + 1 - end = line.find(".pdf") + 4 - name = line[start:end] - print("Found PDF name: " + name) - try: - os.rename("doc.pdf", name) - except: - print("Could not rename PDF file")