[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:
|
||||
ruby-version: 3.1
|
||||
bundler-cache: true
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Setup Release Script
|
||||
run: |
|
||||
git config --global init.defaultBranch main
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from glob import glob
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import json
|
||||
import frontmatter
|
||||
import urllib.request
|
||||
@@ -37,9 +38,11 @@ def fetch_releases(distrowatch_id, regex, template):
|
||||
releases[v] = date
|
||||
return releases
|
||||
|
||||
def update_releases():
|
||||
def update_releases(product_filter=None):
|
||||
for product_file in glob("website/products/*.md"):
|
||||
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:
|
||||
data = frontmatter.load(f)
|
||||
if "auto" in data:
|
||||
@@ -58,4 +61,7 @@ def update_product(product_name, config):
|
||||
print("::endgroup::")
|
||||
|
||||
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