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
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
name: Example of a 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
name: Example with a GitHub commit message

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