3
0
Fork 0
mirror of https://gitea.com/actions/go-hashfiles.git synced 2024-12-04 22:09:31 +01:00
hashfiles/README.md

48 lines
1.1 KiB
Markdown
Raw Normal View History

2023-03-17 08:46:37 +01:00
# go-hashfiles
2023-03-17 10:08:21 +01:00
This action is to compute the SHA256 hash of specified files.
2023-04-07 04:04:16 +02:00
The hash function is based on [nektos/act](https://github.com/nektos/act/blob/ac5dd8feb876d37ae483376a137c57383577dace/pkg/exprparser/functions.go#L183). Thanks!
2023-03-20 11:50:22 +01:00
**NOTE:** This action is written in Go. Please setup the Go environment before running this action or use a runner with Go environment installed.
2023-03-17 10:08:21 +01:00
## 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
2023-03-20 11:35:58 +01:00
# Setup the Go environment. This step can be skipped if Go has been installed.
- uses: actions/setup-go@v3
with:
go-version: '1.20'
2023-03-17 10:08:21 +01:00
- uses: actions/go-hashfiles@v0.0.1
id: get-hash
with:
patterns: |-
go.sum
./admin/*
**/package-lock.json
2023-03-20 11:35:58 +01:00
2023-03-17 10:08:21 +01:00
- name: Echo hash
run: echo ${{ steps.get-hash.outputs.hash }}
```