[distrowatch] Support running single product
This commit is contained in:
3
.github/workflows/update.yml
vendored
3
.github/workflows/update.yml
vendored
@@ -49,6 +49,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ruby-version: 3.1
|
ruby-version: 3.1
|
||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
|
- uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.10'
|
||||||
- name: Setup Release Script
|
- name: Setup Release Script
|
||||||
run: |
|
run: |
|
||||||
git config --global init.defaultBranch main
|
git config --global init.defaultBranch main
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from glob import glob
|
from glob import glob
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import json
|
import json
|
||||||
import frontmatter
|
import frontmatter
|
||||||
import urllib.request
|
import urllib.request
|
||||||
@@ -37,9 +38,11 @@ def fetch_releases(distrowatch_id, regex, template):
|
|||||||
releases[v] = date
|
releases[v] = date
|
||||||
return releases
|
return releases
|
||||||
|
|
||||||
def update_releases():
|
def update_releases(product_filter=None):
|
||||||
for product_file in glob("website/products/*.md"):
|
for product_file in glob("website/products/*.md"):
|
||||||
product_name = os.path.splitext(os.path.basename(product_file))[0]
|
product_name = os.path.splitext(os.path.basename(product_file))[0]
|
||||||
|
if product_filter and product_name != product_filter:
|
||||||
|
continue
|
||||||
with open(product_file, "r") as f:
|
with open(product_file, "r") as f:
|
||||||
data = frontmatter.load(f)
|
data = frontmatter.load(f)
|
||||||
if "auto" in data:
|
if "auto" in data:
|
||||||
@@ -58,4 +61,7 @@ def update_product(product_name, config):
|
|||||||
print("::endgroup::")
|
print("::endgroup::")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
update_releases()
|
if len(sys.argv) > 1:
|
||||||
|
update_releases(sys.argv[1])
|
||||||
|
else:
|
||||||
|
update_releases()
|
||||||
|
|||||||
Reference in New Issue
Block a user