Skip to content

hash-files

Actions
Compute the SHA256 hash of specified files
v1
Latest
Star (3)

hash-files

This action is to compute the SHA256 hash of specified files.

The hash function is based on nektos/act. Thanks!

NOTE: This action is written in Go. Please setup the Go environment before running this action or use a runner with Go environment installed.

Usage

- uses: seepine/hash-files@v1
  with:
    # The working dir for the action.
    # Default: ${{ github.workspace }}
    workdir: ''

    # The patterns used to match files.
    patterns: '**/package-lock.json'

    # Multiple patterns should be seperated by `\n`
    patterns: |
      **/package-lock.json
      **/yarn.lock

Input

Output Item Description Required Default
workdir The working dir for the action false ${{ github.workspace }}
patterns The patterns used to match files true
gitignore Respect ignore patterns in .gitignore files that apply to the globbed files. false true
ignoreFiles Glob patterns to look for ignore files, which are then used to ignore globbed files. false

Output

Output Item Description
hash The computed hash result
matched-files The files matched by the patterns

Example

# Setup the Node environment. This step can be skipped if Node has been installed.
- uses: actions/setup-node@v3

- uses: seepine/hash-files@v1
  id: get-hash
  with: 
    patterns: |
      **/package-lock.json
      **/yarn.lock

- name: Echo hash
  run: echo ${{ steps.get-hash.outputs.hash }}

hash-files 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

Compute the SHA256 hash of specified files
v1
Latest

hash-files 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.