Skip to content

GitHub Action to fix the sha256 file-hashes from the resources defined in "blazor.boot.json" and "service-worker-assets.js".

License

Notifications You must be signed in to change notification settings

StefH/ghaction-BlazorWebAssemblyFileHashFixer

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

ghaction-BlazorWebAssemblyFileHashFixer

GitHub Action to fix the sha256 file-hashes in:

  • blazor.boot.json
  • service-worker-assets.js

Why

In case you deploy your Blazor WebAssembly application on GitHub Pages and do one the modifications below:

The index.html and/or .js files are modified. And when running the Blazor WebAssembly using a service-worker, you can get this error in the console:

Failed to find a valid digest in the 'integrity' attribute for resource 'https://stefh.github.io/xxx/index.html' with computed SHA-256 integrity '/C6AMmjXzNTqgqy8YOF4zcMbioqALgdg/bbhWojItcw='. The resource has been blocked.
Unknown error occurred while trying to verify integrity.
service-worker.js:1 Uncaught (in promise) TypeError: Failed to fetch

Solution

Use this GitHub Action to fix the SHA56 hashes in the blazor.boot.json and service-worker-assets.js files.

Usage

Inputs

wwwroot-path

Required The path to the wwwroot folder. Default this is ..

Example

- name: BlazorWebAssemblyFileHashFixer
  uses: stefh/ghaction-BlazorWebAssemblyFileHashFixer@v1
  with:
    wwwroot-path: ${{ env.PUBLISH_DIR }}

About

GitHub Action to fix the sha256 file-hashes from the resources defined in "blazor.boot.json" and "service-worker-assets.js".

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published