Skip to content

Commit

Permalink
fix: Disallow overrides when getting Git remote in docs-deploy duty
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Sep 5, 2024
1 parent 5c2384f commit cb0135b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions project/duties.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,14 @@ def docs_deploy(ctx: Context) -> None:
if not insiders:
ctx.run(lambda: False, title="Not deploying docs without Material for MkDocs Insiders!")
{%- if insiders %}
origin = ctx.run("git config --get remote.origin.url", silent=True)
origin = ctx.run("git config --get remote.origin.url", silent=True, allow_overrides=False)
if "{{ author_username }}-insiders/{{ insiders_repository_name }}" in origin:
ctx.run("git remote add upstream git@github.com:{{ repository_namespace }}/{{ repository_name }}", silent=True, nofail=True)
ctx.run(
"git remote add upstream git@github.com:{{ repository_namespace }}/{{ repository_name }}",
silent=True,
nofail=True,
allow_overrides=False,
)
ctx.run(
tools.mkdocs.gh_deploy(remote_name="upstream", force=True),
title="Deploying documentation",
Expand Down

0 comments on commit cb0135b

Please sign in to comment.