Go to file
2023-08-02 00:39:45 +08:00
__tests__ chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
.github chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
.vscode chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
dist chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
src chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
.editorconfig chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
.eslintignore chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
.eslintrc.json chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
.gitattributes chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
.gitignore chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
.prettierignore chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
.prettierrc.json chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
action.yml chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
CODEOWNERS chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
jest.config.js chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
LICENSE chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
package-lock.json chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
package.json chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
README.md chore(release): v1.0.0 2023-08-02 00:39:45 +08:00
tsconfig.json chore(release): v1.0.0 2023-08-02 00:39:45 +08:00

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 }}