Generate or validate checksums from strings or command output
Checksum Validate Action
Synopsis
Generate a checksum from either a string or shell command (use command substitution: $()).
Validate if checksum is identical to input (even across multiple jobs), using a key to link the validation attempt with the correct generated checksum.
Validation is possible across jobs since the checksum is uploaded as a workflow artifact
Usage
jobs:
generate-checksums:
name: Generate checksumruns-on: ubuntu-lateststeps:
- uses: actions/checkout@v4.1.1
- name: Generate checksum of stringuses: JosiahSiegel/checksum-validate-action@v1with:
key: test stringinput: hello world
- name: Generate checksum of command outputuses: JosiahSiegel/checksum-validate-action@v1with:
key: test commandinput: $(cat action.yml)validate-checksums:
name: Validate checksumneeds:
- generate-checksumsruns-on: ubuntu-lateststeps:
- uses: actions/checkout@v4.1.1
- name: Validate checksum of valid stringid: valid-stringuses: JosiahSiegel/checksum-validate-action@v1with:
key: test stringvalidate: truefail-invalid: trueinput: hello world
- name: Validate checksum of valid command outputid: valid-commanduses: JosiahSiegel/checksum-validate-action@v1with:
key: test commandvalidate: truefail-invalid: trueinput: $(cat action.yml)
- name: Get outputsrun: | echo ${{ steps.valid-string.outputs.valid }} echo ${{ steps.valid-command.outputs.valid }}
Workflow summary
✅ test string checksum valid ✅
❌ test string checksum INVALID ❌
Inputs
inputs:
validate:
description: Check if checksums matchdefault: falsekey:
description: String to keep unique checksums separaterequired: truefail-invalid:
description: Fail step if invalid checksumdefault: falseinput:
description: String or command for checksumrequired: true
Outputs
outputs:
valid:
description: True if checksums match