Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 972 Bytes

File metadata and controls

30 lines (23 loc) · 972 Bytes

jenkins_githubapp_credentials

Credentials for GitHub App. Requires Jenkins plugin github-branch-source.

Credentials use id, GitHub Application id, GitHub organization owner and private key.

Setup guide for GitHub App with needed permissions.

Convert the private key to single line format with sed -z 's/\n/\\n/g;s/,$/\n/' converted-github-app.pem.

Examples

# Create private key credentials
jenkins_githubapp_credentials 'wcoyote' do
  app_id                '123456'
  description           'Wile E Coyote GitHub App'
  id                    'githubapp-wcoyote'
  owner                 'sous-chefs'
  private_key_pkcs8_pem '-----BEGIN PRIVATE KEY-----\nM...\n-----END PRIVATE KEY-----\n'
end
# Delete private key
jenkins_githubapp_credentials 'wcoyote' do
  id     'githubapp-wcoyote'
  action :delete
end