Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
git-commit

GitHub Action

GitHub Signed Commit

v1.0.3

GitHub Signed Commit

git-commit

GitHub Signed Commit

GitHub Action to create signed commits

Installation

Copy and paste the following snippet into your .yml file.

              

- name: GitHub Signed Commit

uses: ryancyq/github-signed-commit@v1.0.3

Learn more about this action in ryancyq/github-signed-commit

Choose a version

🖋️ Create signed commits with GitHub Actions

CI Coverage

Learn more about commit signature on GitHub.

Features

Works with the GitHub GraphQL API.

  • Uses the Git CLI to detect file changes against the file paths provided in the input.
  • Uses a single GraphQL mutation request to upload all blob file content.
  • Supports glob patterns for file paths.

Known Limitation

Does not support HTTP request streaming, so the action runner will consume more memory during execution when uploading large blob files.

Usage

In your workflow, to commit your files, configure a step as follows:

jobs:
  <job-id>:
    permissions:
      contents: write # grant secrets.GITHUB_TOKEN permission to push file changes
  
    - name: Commit file
      uses: ryancyq/github-signed-commit@v1
      env:
        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        files: |
          path/to/myfile1
          path/to/myfile2
          path/to/myfile3
        commit-message: Committing files

Note: The GH_TOKEN environment variable is required for GitHub API request authentication.

Inputs

Input Required Description
files YES Multi-line string of file paths to be committed, relative to the current workspace.
workspace NO Directory containing files to be committed. DEFAULT: GitHub workspace directory (root of the repository).
commit-message YES Commit message for the file changes.
branch-name NO Branch to commit, it must already exist in the remote. DEFAULT: Workflow triggered branch
branch-push-force NO --force flag when running git push <branch-name>.

Outputs

Output Description
commit-sha Full SHA of the signed commit