github.com/jaylevin/jenkins-library@v1.230.4/resources/metadata/githubCheckBranchProtection.yaml (about) 1 metadata: 2 name: githubCheckBranchProtection 3 description: Check branch protection of a GitHub branch 4 longDescription: | 5 This step allows you to check if certain branch protection rules are fulfilled. 6 7 It can for example be used to verify if certain status checks are mandatory. This can be helpful to decide if a certain check needs to be performed again after merging a pull request. 8 spec: 9 inputs: 10 secrets: 11 - name: githubTokenCredentialsId 12 description: Jenkins 'Secret text' credentials ID containing token to authenticate to GitHub. 13 type: jenkins 14 params: 15 - name: apiUrl 16 aliases: 17 - name: githubApiUrl 18 description: Set the GitHub API url. 19 scope: 20 - GENERAL 21 - PARAMETERS 22 - STAGES 23 - STEPS 24 type: string 25 default: https://api.github.com 26 mandatory: true 27 - name: branch 28 description: The name of the branch for which the protection settings should be checked. 29 scope: 30 - PARAMETERS 31 - STAGES 32 - STEPS 33 type: string 34 default: master 35 mandatory: true 36 - name: owner 37 aliases: 38 - name: githubOrg 39 description: Name of the GitHub organization. 40 resourceRef: 41 - name: commonPipelineEnvironment 42 param: github/owner 43 scope: 44 - PARAMETERS 45 - STAGES 46 - STEPS 47 type: string 48 mandatory: true 49 - name: repository 50 aliases: 51 - name: githubRepo 52 description: Name of the GitHub repository. 53 resourceRef: 54 - name: commonPipelineEnvironment 55 param: github/repository 56 scope: 57 - PARAMETERS 58 - STAGES 59 - STEPS 60 type: string 61 mandatory: true 62 - name: requiredChecks 63 description: List of checks which have to be set to 'required' in the GitHub repository configuration. 64 scope: 65 - PARAMETERS 66 - STAGES 67 - STEPS 68 type: "[]string" 69 - name: requireEnforceAdmins 70 description: Check if 'Include Administrators' option is set in the GitHub repository configuration. 71 scope: 72 - PARAMETERS 73 - STAGES 74 - STEPS 75 type: bool 76 - name: requiredApprovingReviewCount 77 description: Check if 'Require pull request reviews before merging' option is set with at least the defined number of reviewers in the GitHub repository configuration. 78 scope: 79 - PARAMETERS 80 - STAGES 81 - STEPS 82 type: int 83 - name: token 84 aliases: 85 - name: githubToken 86 - name: access_token 87 description: GitHub personal access token as per https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line. 88 scope: 89 - GENERAL 90 - PARAMETERS 91 - STAGES 92 - STEPS 93 type: string 94 mandatory: true 95 secret: true 96 resourceRef: 97 - name: githubTokenCredentialsId 98 type: secret 99 - type: vaultSecret 100 default: github 101 name: githubVaultSecretName