diff --git a/.github/workflows/make_tracked_links_list.yml b/.github/workflows/make_tracked_links_list.yml index e241089630..f6f3429966 100644 --- a/.github/workflows/make_tracked_links_list.yml +++ b/.github/workflows/make_tracked_links_list.yml @@ -27,17 +27,17 @@ jobs: pip install -r requirements.txt - name: Generate/update file with links. + env: + OUTPUT_FILENAME: "tracked_links_ci.txt" run: | python make_tracked_links_list.py - name: Commit and push changes. run: | git pull - git add . - - git stash git checkout data - git stash pop + + mv tracked_links_ci.txt tracked_links.txt git config --global user.email "github-action@users.noreply.github.com" git config --global user.name "GitHub Action" diff --git a/make_tracked_links_list.py b/make_tracked_links_list.py index 207ce1d32e..fe08e79225 100644 --- a/make_tracked_links_list.py +++ b/make_tracked_links_list.py @@ -1,3 +1,4 @@ +import os import asyncio import logging import re @@ -45,7 +46,7 @@ RELATIVE_LINK_REGEX = r'\/([-a-zA-Z0-9\/@:%._\+~#]{0,249})' DOM_ATTRS = ['href', 'src'] -OUTPUT_FILENAME = 'tracked_links.txt' +OUTPUT_FILENAME = os.environ.get('OUTPUT_FILENAME', 'tracked_links.txt') # unsecure but so simple CONNECTOR = aiohttp.TCPConnector(ssl=False)