Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josiahsiegel/checksum-validate-action
Generate or validate checksums from strings or command output
https://github.com/josiahsiegel/checksum-validate-action
checksum sha256sum
Last synced: 6 days ago
JSON representation
Generate or validate checksums from strings or command output
- Host: GitHub
- URL: https://github.com/josiahsiegel/checksum-validate-action
- Owner: JosiahSiegel
- Created: 2023-11-29T15:43:55.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-08-02T12:36:55.000Z (3 months ago)
- Last Synced: 2024-08-02T14:15:53.330Z (3 months ago)
- Topics: checksum, sha256sum
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Checksum Validate Action
[![Test Action](https://github.com/JosiahSiegel/checksum-validate-action/actions/workflows/test_action.yml/badge.svg)](https://github.com/JosiahSiegel/checksum-validate-action/actions/workflows/test_action.yml)
## Synopsis
1. Generate a checksum from either a string or shell command (use command substitution: `$()`).
2. 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
```yml
jobs:
generate-checksums:
name: Generate checksum
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]- name: Generate checksum of string
uses: JosiahSiegel/checksum-validate-action@v1
with:
key: test string
input: hello world- name: Generate checksum of command output
uses: JosiahSiegel/checksum-validate-action@v1
with:
key: test command
input: $(cat action.yml)validate-checksums:
name: Validate checksum
needs:
- generate-checksums
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]- name: Validate checksum of valid string
id: valid-string
uses: JosiahSiegel/checksum-validate-action@v1
with:
key: test string
validate: true
fail-invalid: true
input: hello world- name: Validate checksum of valid command output
id: valid-command
uses: JosiahSiegel/checksum-validate-action@v1
with:
key: test command
validate: true
fail-invalid: true
input: $(cat action.yml)- name: Get outputs
run: |
echo ${{ steps.valid-string.outputs.valid }}
echo ${{ steps.valid-command.outputs.valid }}
```## Workflow summary
### ✅ test string checksum valid ✅
### ❌ test string checksum INVALID ❌
## Inputs
```yml
inputs:
validate:
description: Check if checksums match
default: false
key:
description: String to keep unique checksums separate
required: true
fail-invalid:
description: Fail step if invalid checksum
default: false
input:
description: String or command for checksum
required: true
```## Outputs
```yml
outputs:
valid:
description: True if checksums match
```