diff --git a/jenkins_jobs/modules/project_githuborg.py b/jenkins_jobs/modules/project_githuborg.py index 1ef6fbdae..e6ab7f9a2 100644 --- a/jenkins_jobs/modules/project_githuborg.py +++ b/jenkins_jobs/modules/project_githuborg.py @@ -248,6 +248,8 @@ def github_org(xml_parent, data): (like to disable SCM triggering or to override the pipeline durability) (optional) Refer to :func:`~property_strategies `. + :arg bool exclude-archived-repositories: Whether archived repositories are + excluded when scanning an organization. (default: false) (optional) :arg bool ssh-checkout: Checkout over SSH. * **credentials** ('str'): Credentials to use for @@ -452,3 +454,9 @@ def github_org(xml_parent, data): "".join([disable_github_status_path_dscore, ".DisableStatusUpdateTrait"]), {"plugin": "disable-github-multibranch-status"}, ) + + if data.get("exclude-archived-repositories", False): + XML.SubElement( + traits, + "".join([github_path_dscore, ".ExcludeArchivedRepositoriesTrait"]), + ) diff --git a/tests/githuborg/fixtures/github-org-full.xml b/tests/githuborg/fixtures/github-org-full.xml index 90c8f5173..4c46cc1b3 100644 --- a/tests/githuborg/fixtures/github-org-full.xml +++ b/tests/githuborg/fixtures/github-org-full.xml @@ -139,6 +139,7 @@ + diff --git a/tests/githuborg/fixtures/github-org-full.yaml b/tests/githuborg/fixtures/github-org-full.yaml index 3525e6301..2494c58ef 100644 --- a/tests/githuborg/fixtures/github-org-full.yaml +++ b/tests/githuborg/fixtures/github-org-full.yaml @@ -30,6 +30,7 @@ github-org: discover-pr-forks-trust: everyone discover-pr-origin: both discover-tags: true + exclude-archived-repositories: true notification-context: label: 'jenkins.example.com/my_context' suffix: false