marcomow / verified-commit

✅ GitHub Action to create verified commits (forked from https://github.com/swinton/commit)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Verified Commit

✅ Create a verified commit with GitHub Actions

code style: prettier

About

This action allows you to create a commit with GitHub Actions. Commits created with this actions will be marked as verified.

This repo is forked from https://github.com/swinton/commit.

image

Usage

In your workflow, to commit a file ./myfile, include a step like this:

    - name: Commit file
      uses: tohgarashi/verified-commit@v2.x
      env:
        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        files: |
          myfile
        commit-message: Committing ./myfile
        ref: refs/heads/my-branch

Note, the GH_TOKEN environment variable is required, since commits are created using GitHub's Git Database API.

To commit multiple files in a single commit, pass each file on a newline to the files input:

    - name: Commit files
      uses: tohgarashi/verified-commit@v2.x
      env:
        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        files: |
          path/to/myfile1
          path/to/myfile2
          path/to/myfile3
        commit-message: Committing files
        ref: refs/heads/my-branch

detect-changed

To detect changed files automatically and commit them, set detect-changed input to true:

    - name: Commit files
      uses: tohgarashi/verified-commit@v2.x
      env:
        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        detect-changed: true
        commit-message: Committing files
        ref: refs/heads/my-branch

No files

If files input is not set and changed files are not detected, this action do nothing.

Inputs

  • detect-changed: If true, this action automatically detects files that have been changed.
  • files: Newline-separated list of files to be committed, relative to root of repository, e.g.
    myfile1
    myfile2
    ...
    myfileN
  • commit-message: Commit message to be used, e.g. Add ./myfile
  • ref: Fully qualified name of reference to be updated with commit, e.g. refs/heads/production. This reference must already exist. Defaults to the repository's default branch ref.

Outputs

This action provides the following outputs:

  • commit-sha: SHA of created commit

About

✅ GitHub Action to create verified commits (forked from https://github.com/swinton/commit)

License:ISC License


Languages

Language:TypeScript 90.9%Language:JavaScript 9.1%