mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Allow jobs on forks which have self hosted runners setup.
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
d64b74ff91
commit
2e3b27e775
1 changed files with 5 additions and 2 deletions
|
@ -196,7 +196,10 @@ def runner_types(ctx: Context, event_name: str):
|
|||
|
||||
# This is a push or a scheduled event
|
||||
ctx.info(f"Running from a {event_name!r} event")
|
||||
if gh_event["repository"]["fork"] is True:
|
||||
if (
|
||||
gh_event["repository"]["fork"] is True
|
||||
and os.environ.get("FORK_HAS_SELF_HOSTED_RUNNERS", "0") == "1"
|
||||
):
|
||||
# This is running on a forked repository, don't run tests
|
||||
ctx.info("The push event is on a forked repository")
|
||||
runners["github-hosted"] = True
|
||||
|
@ -205,7 +208,7 @@ def runner_types(ctx: Context, event_name: str):
|
|||
wfh.write(f"runners={json.dumps(runners)}\n")
|
||||
ctx.exit(0)
|
||||
|
||||
# Not running on a fork, run everything
|
||||
# Not running on a fork, or the fork has self hosted runners, run everything
|
||||
ctx.info(f"The {event_name!r} event is from the main repository")
|
||||
runners["github-hosted"] = runners["self-hosted"] = True
|
||||
ctx.info("Writing 'runners' to the github outputs file")
|
||||
|
|
Loading…
Add table
Reference in a new issue