checksum-action
is a GitHub Action that generates SHA256 checksums for multiple files in your GitHub repository. It allows you to specify a pattern for matching files and optionally specify a suffix for the generated checksum files.
Required The pattern used to search for files (glob format). For example:
pattern: "*.txt"
This would match all .txt
files in the repository.
Optional The suffix to append to the generated checksum files. Default is checksum
.
For example, given a file example.txt
, if the suffix is set to checksum
, the generated checksum file will be example.txt.checksum
.
Here's a basic example that demonstrates how to use checksum-action
in a workflow:
name: Generate Checksums
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate checksums
uses: Solratic/checksum-action@v1
with:
pattern: "<your folder>/*.txt"
suffix: "checksum"
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
This workflow will be triggered on a push to the main
branch. It will:
- Checkout the repository
- Generate SHA256 checksums for all
.txt
files in the repository - Append
.checksum
to the generated checksum files. - You would see
<your folder>/<file>.txt.checksum
in your repository.
This action runs on a Docker container, specified in the Dockerfile
in this repository.
Feel free to open issues or pull requests if you want to improve this GitHub action.
Please see the LICENSE file for details on how the code in this repo is licensed.