Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-circle

GitHub Action

Checksums Action

v1.0.0

Checksums Action

check-circle

Checksums Action

A reusable action to create checksum.txt

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Checksums Action

uses: thewh1teagle/checksum@v1.0.0

Learn more about this action in thewh1teagle/checksum

Choose a version

checksum

This action calculates the checksum (e.g., SHA-256) for all assets in your GitHub releases and generates a checksum.txt file. This is useful for ensuring file integrity during downloads and uploads.

Usage

Include in your workflow file:

uses: thewh1teagle/checksum@v1
with:
  patterns: | # Optional
    *.zip
    *.tar.gz
  algorithm: sha256 # Optional. See bun.sh/docs/api/hashing#bun-cryptohasher for supported algorithms

You must enable write permission in github.com/user/repo/settings/actions -> Workflow permissions -> Read and write permissions.

Inputs

Input Name Description Required Default
repo The GitHub repository in the format owner/repo. No
patterns File patterns to run checksum on. Supports glob patterns like *.zip, *.tar.gz. No "" (all files)
algorithm Hash algorithm to use. Defaults to sha256. See Bun hashing documentation. No sha256
pre-release Whether to run on pre-releases. No false
tag The tag of the release to generate checksums for. No ''
file-name The name of the checksum file to generate. No checksum.txt
dry-run Run without upload. will be available in the console output of the action. No checksum.txt
bun-version The version of Bun to use. No latest

Example checksum.txt

a.txt	ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb
b.txt	0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f

Each line separated by tab. (\t)

Full example

name: Create checksum.txt

on:
  schedule:
    - cron: "0 1 * * *" # Runs at 1:00 AM UTC daily
  workflow_dispatch:

jobs:
  test:
    runs-on: macos-latest

    steps:
      - name: Run checksum action
        uses: thewh1teagle/checksum@v1
        with:
          patterns: | # Optional
            *.zip
            *.tar.gz
            *.txt
            !b.txt
          algorithm: sha256 # Optional
        env:
          # You must enable write permission in github.com/user/repo/settings/actions -> Workflow permissions -> Read and write permissions
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}