esp.bitbucket.git_commit (1.4.1) — module

Commit changes to the local repository

| "added in version" 1.3.1 of esp.bitbucket"

Authors: Pawel Smolarz (pawel.smolarz@nordea.com), Krzysztof Lewandowski (@klewan)

Install collection

Install with ansible-galaxy collection install esp.bitbucket:==1.4.1


Add to requirements.yml

  collections:
    - name: esp.bitbucket
      version: 1.4.1

Description

Creates a new commit containing the current contents of the index and the working tree.

Returns the commit hash.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Commit changes to the local repository
  esp.bitbucket.git_commit:  
    repository: repo
    path: /tmp/repo    
    msg: New commit message
    committer:
      name: jsmith
      email: jsmith@example.com
    tag: '0.3.1'
  register: _result

Inputs

    
msg:
    description:
    - Log message describing the changes.
    required: true
    type: str

tag:
    description:
    - Opitionally add a tag to the commit.
    required: false
    type: str

repodir:
    aliases:
    - path
    description:
    - Repository directory.
    - This must be a valid git repository.
    required: true
    type: str

committer:
    description:
    - A person who commits the code.
    required: true
    suboptions:
      email:
        description:
        - The committer email address.
        required: true
        type: str
      name:
        description:
        - The committer username.
        required: true
        type: str
    type: dict

repository:
    description:
    - Repository name.
    required: true
    type: str

Outputs

changed:
  description: Whether or not changes were committed.
  returned: success
  sample: true
  type: bool
json:
  contains:
    after_commit_hexsha:
      description: New commit hash. Exposed only when changes were actually committed,
        i.e. when C(changed=true).
      returned: success
      sample: 06bdcc6594831af4fe869b87643efc609d7cd994
      type: str
    author:
      description: Commit request author.
      returned: success
      sample:
        email: john.smith@example.com
        name: jsmith
      type: dict
    before_commit_hexsha:
      description: A commit hash of the working tree before changes were committed.
      returned: success
      sample: c1bd91851a8f5b2b147d252ba674329773e7f675
      type: str
    committer:
      description: Committer.
      returned: success
      sample:
        email: john.smith@example.com
        name: jsmith
      type: dict
    msg:
      description: Commit message.
      returned: success
      sample: Commit message
      type: str
    tag:
      description: Commit tag.
      returned: success
      sample: 0.3.1
      type: str
  description: Dictionary with commit details.
  returned: success
  type: dict