Skip to content

GitHub Action to create signed commits from within a GitHub Action workflow

License

Notifications You must be signed in to change notification settings

qoomon/actions--create-commit

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Create Commit   Actions

This action will create a new commit via GitHub API, committer and author are related to given token identity. Commits getting signed, if a GitHub App token (ghs_***) is used and will be marked as verified in the GitHub web interface.

Example

jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.ref }}
      - run: |
          date > dummy.txt
          git add dummy.txt

      - uses: qoomon/actions--create-commit@v1
        id: commit
        with:
          message: work work
          skip-empty: true

      - if: ${{ steps.commit.outputs.commit }}
        run: git push

Inputs

inputs:
  message:
    description: 'The commit message'
    required: true
  amend:
    description: 'Amend the last commit'
    default: false
  allow-empty:
    description: 'Allow an empty commit'
    default: false
  skip-empty:
    description: 'Skip action, if nothing to commit'
    default: false

  token:
    description: 'A GitHub access token'
    required: true
    default: ${{ github.token }}
  working-directory:
    description: 'The working directory'
    required: true
    default: '.'
  remoteName:
    description: 'The remote name to create the commit at.'
    required: true
    default: 'origin'

Outputs

outputs:
  commit:
    description: 'The commit hash, if a commit was created'

Development

Release New Action Version

Trigger Release Version workflow