Github

kind: github

Description

Depending on the situation a specific SCM block can be provided to manipulate information from a Github SCM repository by either fetching files from a repository or pushing files to them

condition

When the SCM block is used in a condition, it usually means fetching a file from that repository.

target

When the SCM block is used in a target, it usually means pushing a file to that repository.

It’s important to notice that the Github SCM implements the Github workflow and therefore will push changes to a temporary branch then open a pull request targeting the branch defined in the configuration.

Parameters

NameTypeDescriptionRequired
branchstringBranch specifies which github branch to work on
commitmessageobjectCommitMessage represents conventional commit metadata as type or scope, used to generate the final commit message.
    bodystringDefine commit body
    footersstringDefine commit footer
    hidecreditbooleanDisplay updatecli credits inside commit message body
    scopestringDefine commit type scope
    titlestringDefine commit title
    typestringDefine commit type, like chore, fix, etc
directorystringDirectory specifies where the github repository is cloned on the local disk
emailstringEmail specifies which emails to use when creating commits
forcebooleanForce is used during the git push phase to run `git push --force`.
gpgobjectGPG key and passphrased used for commit signing
    passphrasestringDefine the gpg passphrase
    signingkeystringDefines the gpg key
ownerstringOwner specifies repository owner
pullrequestobjectDeprecated since https://github.com/updatecli/updatecli/issues/260, must be clean up
    automergebooleanSpecifies if automerge is enabled for the new pullrequest
    descriptionstringSpecifies user input description used during pull body creation
    draftbooleanSpecifies if a pull request is set to draft, default false
    labelsarraySpecifies repository labels used for pull request. !! Labels must already exist on the repository
    maintainercannotmodifybooleanSpecifies if maintainer can modify pullRequest
    mergemethodstringSpecifies which merge method is used to incorporate the pull request. Accept "merge", "squash", "rebase", or ""
    titlestringSpecifies pull request title
    usetitleforautomergebooleanSpecifies to use pull request title when using auto merge, only works for "squash" or "rebase"
repositorystringRepository specifies the name of a repository for a specific owner
tokenstringToken specifies the credential used to authenticate with
urlstringURL specifies the default github url in case of GitHub enterprise
userstringUser specifies the user of the git commit messages
usernamestringUsername specifies the username used to authenticate with Github API

CommitMessage

Updatecli uses conventional commits as describe on www.conventionnalcommits.org.
The goal is to add human and machine readable meaning to commit messages

By default, Updatecli generates a commit message using the default type "chore" and split long title message into the body like:


Author: olblak <updatecli@updatecli.io>
Date:   Tue May 4 15:41:44 2021 +0200

    chore: Update key "dependencies[0].version" from file "charts/jenkins/r...

    ... equirements.yaml"

    Made with ❤️️  by updatecli

Example

Default

# updatecli.yaml
title: Show a basic github scm configuration
scms:
  default:
    kind: github:
    spec: user: "git user to push from changes"
      email: "git user email to push from change"
      directory: "directory where to clone the git repository"
      owner: "github owner"
      repository: "github repository"
      token: "github token with enough permission on repository"
      username: "github username used for push git changes"
      branch: "git branch where to push changes"

targets:
  id:
    kind: yaml
    scmid: default
    spec:
      file: "Yaml file path from the root repository"
      key: "yaml key to update"

CommitMessage

# updatecli.yaml
title: Show commitmessage usage
scms:
  default:
    kind: github
    spec:
      user: "git user to push from changes"
      email: "git user email to push from change"
      directory: "directory where to clone the git repository"
      owner: "github owner"
      repository: "github repository"
      token: "github token with enough permission on repository"
      username: "github username used for push git changes"
      branch: "git branch where to push changes"
      commitMessage:
        type: "feat"
        title: "Override default commit title"

targets:
  id:
    kind: yaml
    scmid: default
    spec:
      file: "Yaml file path from the root repository"
      key: "yaml key to update"
Top