Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
rename cron workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ericLemanissier committed May 14, 2024
1 parent ca097e9 commit 85c27bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Generate Job Matrix
id: set-matrix
run: |
python3 main.py
python3 generate-matrix.py bsd
MATRIX=$(cat matrix.yml)
echo "${MATRIX}"
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
Expand Down
7 changes: 4 additions & 3 deletions main.py → generate-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
from datetime import datetime
from typing import Dict, Set, Any
import sys
import yaml
import requests
import aiohttp
Expand All @@ -17,7 +18,7 @@ class MatrixGenerator:
repo: str = "conan-center-index"
dry_run: bool = False

def __init__(self, token: str = "", user: str = "", pw: str = ""): # noqa: MC0001
def __init__(self, keyword: str, token: str = "", user: str = "", pw: str = ""): # noqa: MC0001
self.session = requests.session()
if token:
self.session.headers["Authorization"] = f"token {token}"
Expand Down Expand Up @@ -45,7 +46,7 @@ def __init__(self, token: str = "", user: str = "", pw: str = ""): # noqa: MC00
logging.warning("ignoring pr #%s because it is in deny list", p["number"])
continue
body = p["body"] or ""
if "bsd" in p["title"].lower() or "bsd" in body.lower():
if keyword in p["title"].lower() or keyword in body.lower():
self.prs[int(p["number"])] = p
page += 1
if not results:
Expand Down Expand Up @@ -123,7 +124,7 @@ def _make_request(self, method: str, url: str, **kwargs) -> requests.Response:


def main() -> None:
d = MatrixGenerator(token=os.getenv("GH_TOKEN", ""))
d = MatrixGenerator(sys.argv[1], token=os.getenv("GH_TOKEN", ""))
asyncio.run(d.generate_matrix())


Expand Down

0 comments on commit 85c27bc

Please sign in to comment.