Skip to content

Latest commit

 

History

History
53 lines (42 loc) · 1.48 KB

File metadata and controls

53 lines (42 loc) · 1.48 KB

Create a git commit

A composite action for committing the current staged content.

Inputs

Name Description Default
title (*) The title of the commit message N/A
body The body of the commit message ""
user-email The email of the user to commit as "octocat@users.noreply.github.com"
user-name The default user to commit as "Octocat"

Note: (*) marks required inputs

Outputs

Name Description
sha1 The SHA1 of the newly created commit
sha1-short The short/succinct SHA1 of the newly created commit

Example

Here is a very basic example of how to use the git/commit composite action in a project (placeholders are used in place of real inputs):

run:
  example-job:
    # ... 
    steps:
      # ... 
      - name: Create a git commit
        id: git-commit # only necessary if using this action's output(s)
        uses: bitwizeshift/actions-github/git/commit@v1
        with:
          # Required inputs
          title: TITLE

          # Optional inputs
          body: BODY
          user-email: USER_EMAIL
          user-name: USER_NAME
      # ... 
      - name: Uses "Create a git commit" Outputs
        uses: example-actions/use-git-commit@v3 # illustrative
        with:
          use-sha1: ${{ steps.git-commit.outputs.sha1 }}
          use-sha1-short: ${{ steps.git-commit.outputs.sha1-short }}