You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1003 B
Markdown

2 years ago
# go-hashfiles
2 years ago
This action is to compute the SHA256 hash of specified files.
2 years ago
**NOTE:** This action is written in Go. Please setup the Go environment before running this action or make sure the `runs-on` runner supports running Go actions.
2 years ago
## Usage
``` yml
- uses: actions/go-hashfiles@v0.0.1
with:
# The working dir for the action.
# Default: ${{ github.workspace }}
workdir: ''
# The patterns used to match files.
# Multiple patterns should be seperated by `\n`
patterns: ''
```
## Output
|Output Item|Description|
|---|---|
|hash|The computed hash result|
|matched-files|The files matched by the patterns|
## Example
``` yml
2 years ago
# Setup the Go environment. This step can be skipped if Go has been installed.
- uses: actions/setup-go@v3
with:
go-version: '1.20'
2 years ago
- uses: actions/go-hashfiles@v0.0.1
id: get-hash
with:
patterns: |-
go.sum
./admin/*
**/package-lock.json
2 years ago
2 years ago
- name: Echo hash
run: echo ${{ steps.get-hash.outputs.hash }}
```