@@ -83,6 +83,9 @@ def main(args):
8383ssl_verify=true
8484
8585
86+ ### GitHub Enterprise Teams
87+ enterprise_team_name="enterprise-team1"
88+
8689### GitHub API Version
8790# https://docs.github.com/en/rest/overview/api-versions
8891github_api_version=${github_api_version}
@@ -91,6 +94,7 @@ def main(args):
9194# https://docs.github.com/en/organizations
9295org="${org}"
9396owner="${org}"
97+ org_webhook_url=${org_webhook_url}
9498org_secret_name="PWR_ORG_SECRET_001"
9599org_owner="${org_owner}"
96100org_members="${org_members}"
@@ -107,7 +111,7 @@ def main(args):
107111repo_secret_name="REPOSITORY_SECRET_001"
108112repo_secret_value="repository_secret_string"
109113# webhook url is also used by the organization
110- webhook_url =${webhook_url }
114+ repo_webhook_url =${repo_webhook_url }
111115repo_webhook_secret="pwr-repo-webhook-secret"
112116has_issues=true
113117has_wiki=true
@@ -238,6 +242,7 @@ def main(args):
238242ent_app_client_secret=${ent_app_client_secret}
239243ent_app_private_pem=${ent_app_private_pem}
240244ent_app_installation_id=${ent_app_installation_id}
245+ ent_app_org_installation_id=${ent_app_org_installation_id}
241246
242247
243248### [GitHub Apps](https://docs.github.com/en/rest/apps)
@@ -254,6 +259,7 @@ def main(args):
254259# private_pem_file=/opt/the-power/testapp.YYYY-MM-DD.private-key.pem
255260# #=> The absolute path of the pem file is /opt/the-power/Downloads/testapp.YYYY-MM-DD.private-key.pem
256261#
262+ app_configure=${app_configure}
257263app_private_pem=${app_private_pem}
258264# When working with the power in a codespace you may need a path like:
259265#private_pem_file=../../workspaces/the-power/ft-testapp.2022-03-23.private-key.pem
@@ -426,7 +432,7 @@ def main(args):
426432 args .org = input (f"Enter Org name: " )
427433
428434 # If configuring a GitHub App:
429- if args .configure_github_app != "no" :
435+ if args .app_configure != "no" :
430436 if args .app_id != "" :
431437 logger .info (f"default_app_id = { args .app_id } " )
432438 else :
@@ -453,22 +459,22 @@ def main(args):
453459 f"Enter path relative from home to app private key: "
454460 )
455461
456- if args .webhook_url == "smee" :
457- webhook_url = thepower .get_webhook_url ()
458- if webhook_url is None :
459- webhook_url = input (f"Enter webhook URL: " )
462+ if args .repo_webhook_url == "smee" :
463+ repo_webhook_url = thepower .get_webhook_url ()
464+ if repo_webhook_url is None :
465+ repo_webhook_url = input (f"Enter webhook URL: " )
460466
461- args .webhook_url = webhook_url
462- if re .match (r"^https?://" , args .webhook_url ):
463- thepower .open_webhook_url_in_browser (args .webhook_url )
467+ args .repo_webhook_url = repo_webhook_url
468+ if re .match (r"^https?://" , args .repo_webhook_url ):
469+ thepower .open_webhook_url_in_browser (args .repo_webhook_url , anon = True )
464470 else :
465471 logger .info (
466472 "No webhook URL supplied. You can still set a webhook URL in .gh-api-examples.conf file."
467473 )
468- elif args .webhook_url :
469- logger .info (f"Webhook URL = { args .webhook_url } " )
474+ elif args .repo_webhook_url :
475+ logger .info (f"Webhook URL = { args .repo_webhook_url } " )
470476 else :
471- args .webhook_url = input (f"Enter webhook url: " )
477+ args .repo_webhook_url = input (f"Enter webhook url: " )
472478
473479 out_filename = ".gh-api-examples.conf"
474480
@@ -503,7 +509,7 @@ def main(args):
503509 parser .add_argument (
504510 "--app-configure" ,
505511 action = "store" ,
506- dest = "configure_github_app " ,
512+ dest = "app_configure " ,
507513 default = "no" ,
508514 )
509515 parser .add_argument (
@@ -517,7 +523,7 @@ def main(args):
517523 action = "store" ,
518524 dest = "app_id" ,
519525 default = "1" ,
520- help = "an app id (integer)" ,
526+ help = "an app id" ,
521527 )
522528 parser .add_argument (
523529 "--app-installation-id" ,
@@ -562,12 +568,18 @@ def main(args):
562568 "--mgmt-port" , action = "store" , dest = "mgmt_port" , default = 8443
563569 )
564570 parser .add_argument (
565- "-w" ,
566- "--webhook-url" ,
571+ "--repo-webhook-url" ,
567572 action = "store" ,
568- dest = "webhook_url " ,
573+ dest = "repo_webhook_url " ,
569574 default = "smee" ,
570- help = "Set this if you want to provide your own webhook url." ,
575+ help = "Set this if you want to provide your own webhook url for a repository." ,
576+ )
577+ parser .add_argument (
578+ "--org_webhook-url" ,
579+ action = "store" ,
580+ dest = "org_webhook_url" ,
581+ default = "https://example.com/webhook" ,
582+ help = "Set this if you want to provide your own webhook url for a repository." ,
571583 )
572584 parser .add_argument (
573585 "--x-client-id" ,
@@ -620,8 +632,7 @@ def main(args):
620632 help = "Set this for github.com config" ,
621633 )
622634 parser .add_argument (
623- "-r" ,
624- "--repo-name" ,
635+ "--repo" ,
625636 action = "store" ,
626637 dest = "repo_name" ,
627638 default = "testrepo" ,
@@ -678,6 +689,13 @@ def main(args):
678689 default = "0" ,
679690 help = "" ,
680691 )
692+ parser .add_argument (
693+ "--enterprise-app-org-installation-id" ,
694+ action = "store" ,
695+ dest = "ent_app_org_installation_id" ,
696+ default = "0" ,
697+ help = "enterprise app org installation id" ,
698+ )
681699 parser .add_argument (
682700 "--enterprise-app-id" ,
683701 action = "store" ,
@@ -706,7 +724,6 @@ def main(args):
706724 default = "ent_app_client_secret" ,
707725 help = "An enterprise app client secret." ,
708726 )
709-
710727 parser .add_argument (
711728 "--number-of-orgs" ,
712729 action = "store" ,
0 commit comments