githuborg: Support ignoring archived repositories in an organization

Change-Id: Icb3591882e29a92819794e9bdcdc2c2f9f617016
This commit is contained in:
Stephen Boyd 2024-05-20 14:41:26 -07:00
parent f62ec53e82
commit 06fab3c38a
No known key found for this signature in database
GPG Key ID: 276674E18F6FBD22
3 changed files with 10 additions and 0 deletions

View File

@ -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 <project_multibranch.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"]),
)

View File

@ -139,6 +139,7 @@
</templates>
</jenkins.plugins.git.traits.RefSpecsSCMSourceTrait>
<com.adobe.jenkins.disable__github__multibranch__status.DisableStatusUpdateTrait plugin="disable-github-multibranch-status"/>
<org.jenkinsci.plugins.github__branch__source.ExcludeArchivedRepositoriesTrait/>
</traits>
<strategy class="jenkins.branch.DefaultBranchPropertyStrategy">
<properties class="java.util.Arrays$ArrayList">

View File

@ -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