Skip to content

GitHub Signed Commit

Actions

About

GitHub Action to create signed commits
v1.4.1
Latest
Star (1)

🖋️ Create signed commits with GitHub Actions

CICoverageMaintainability

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.
  • Push tag to the new/current commit on a branch.

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 fileuses: ryancyq/github-signed-commit@v1env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}with:
files: | path/to/myfile1 path/to/*.md path/to/**/*.jscommit-message: Committing files
jobs:
<job-id>:
permissions:
contents: write # grant secrets.GITHUB_TOKEN permission to push file changes
- name: Commit fileuses: ryancyq/github-signed-commit@v1env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}with:
files: path/to/myversioncommit-message: Release new versiontag: v1.0.3

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

Inputs

InputRequiredDescription
filesYESMulti-line string of file paths to be committed, relative to the current workspace.
workspaceNODirectory containing files to be committed. DEFAULT: GitHub workspace directory (root of the repository).
commit-messageYESCommit message for the file changes.
repositoryNORepository name including owner (e.g. owner/repo). DEFAULT: Workflow triggered repository
branch-nameNOBranch to commit, it must already exist in the remote. DEFAULT: Workflow triggered branch
branch-push-forceNO--force flag when running git push <branch-name>.
tagNOPush tag for the new/current commit.
tag-only-if-file-changesNOPush tag for new commit only when file changes present. DEFAULT: true

Outputs

OutputDescription
commit-shaFull SHA of the signed commit.
tagTag of the signed commit.

GitHub Signed Commit is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

GitHub Action to create signed commits
v1.4.1
Latest

GitHub Signed Commit is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.