Skip to content

Commit

Permalink
Remove news type from path as it is already inside folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivansh-007 committed Oct 20, 2021
1 parent 4f45db1 commit bee0dab
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/news/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def save_news_fragment(ctx: click.Context, gh_pr: int, nonce: str, news_entry: s
date = datetime.now(timezone.utc).strftime("%Y-%m-%d")
path = Path(
Path.cwd(),
f"news/next/{news_type}/{date}.pr-{str(gh_pr)}.{news_type}.{nonce}.md",
f"news/next/{news_type}/{date}.pr-{str(gh_pr)}.{nonce}.md",
)
if not path.parents[1].exists():
err(NO_NEWS_PATH_ERROR, fg="blue")
Expand Down
4 changes: 0 additions & 4 deletions scripts/news/check_news_workflow/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@ def load_toml_config() -> dict:
return toml_dict


CONFIG = load_toml_config()
SECTIONS = [_type for _type, _ in CONFIG.get("types").items()]

FILENAME_RE = re.compile(
r"\d{4}-\d{2}-\d{2}(?:-\d{2}-\d{2}-\d{2})?\." # match `yyyy-mm-dd` or `yyyy-m-d`
r"pr-\d+(?:,\d+)*\." # Issue number(s)
fr"({'|'.join(SECTIONS)})\." # Section type
r"[A-Za-z0-9_=-]+\." # Nonce (URL-safe base64)
r"md", # File extension
re.VERBOSE,
Expand Down

0 comments on commit bee0dab

Please sign in to comment.