---
title: "Fix Blazor WebAssembly PWA integrity checks"
excerpt: "The service-worker-assets.js file is generated during publish and any modification made to the listed files after publish will cause the integrity check to fail."
publishDate: "2020-12-30T00:00:00"
createDate: "2020-12-30T21:23:08.347"
updateDate: "2020-12-31T01:49:21.55"
category: "dotnet"
categoryName: ".NET"
tags: [".NET","ASP.NET",".NET Core","ASP.NET Core","dotnetcore","aspnetcore","dotnet","aspnet","Blazor","WASM","Blazor WASM","WebAssembly","PWA"]
permalink: "/blog/dotnet/fix-blazor-webassembly-pwa-integrity-checks"
canonical: "/blog/dotnet/fix-blazor-webassembly-pwa-integrity-checks"
image: null
imageAlt: ""
imageBackgroundColor: "#fafafa"
thumbnailImage: {"src":"/media/ttaf0suj/blazor-square.png","focalPoint":{"left":0.5,"top":0.5},"crops":[{"alias":"thumbnail","width":250,"height":250,"coordinates":null}]}
thumbnailImageAlt: "Blazor logo"
metaTitle: "Fix Blazor WebAssembly PWA integrity checks"
metaDescription: "The service-worker-assets.js file is generated during publish and any modification made to the listed files after publish will cause the integrity check to fail."
ogTitle: "Fix Blazor WebAssembly PWA integrity checks"
ogDescription: "The service-worker-assets.js file is generated during publish and any modification made to the listed files after publish will cause the integrity check to fail."
ogImage: null
ogImageAlt: ""
relatedPostKeys: ["b01d783c18284f05b29774abcd096471","0d375026e40743fdadc9c3b841802a6a"]
noIndex: false
noFollow: false
sitemapExclude: false
source: {"nodeId":1397,"contentKey":"4a4a922a16eb423f8adbfebf3ab5917f","sortOrder":74}
---


I recently released a <a href="/blog/dotnet/how-to-deploy-aspnet-blazor-webassembly-to-github-pages" title="How to deploy ASPNET Blazor WebAssembly to GitHub Pages">how-to article</a> and <a rel="noopener" href="https://youtu.be/nNxII6jvPvQ" target="_blank">video</a> on deploying Blazor WASM to GitHub Pages. In this content I demonstrated how to deploy Blazor WASM to GitHub pages manually and automatically using GitHub Actions, but I did not have the PWA feature enabled. When you create a Blazor WASM application, you can pass a `--pwa` flag to include PWA support.


It turns out that the PWA feature breaks in those how-to's. The service worker requests all the files with integrity checking, and in those how-to's the base-tag of the index.html file is modified. This modification causes the integrity check to fail because the pre-calculated hash stored in *service-worker-assets.js* for *index.html* mismatches. The result was the following error:

<pre style="color:#000000;background:#ffffff;">Service worker: Install&#10;Failed to find a valid digest in the <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">integrity</span><span style="color:#2a00ff; ">'</span> attribute for resource <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">http://YOURURL/index.html</span><span style="color:#2a00ff; ">'</span> with computed SHA-256 integrity <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">sYKnuzlqE606K8G3ejaHYO2arpP3AQOjtIDxiCzAKyA=</span><span style="color:#2a00ff; ">'</span>. The resource has been blocked.&#10;Unknown error occurred while trying to verify integrity.&#10;service-worker.js:1 Uncaught (in promise) TypeError: Failed to fetch&#10;</pre>

This issue will surface when any modification is made to the files listed in the *service-worker-assets.js* file. The *service-worker-assets.js* file is generated during publish and any modification made to the listed files after publish will cause the integrity check to fail.

## Solution {#solution}




<a rel="noopener" href="https://docs.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly#diagnosing-integrity-problems" target="_blank">Microsoft's documentation</a> has some guidance on how to detect and troubleshoot this issue. You have the option to <a rel="noopener" href="https://docs.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly#disable-integrity-checking-for-pwas" target="_blank">disable the integrity checking altogether</a>, but you will lose the safety guarantees offered by integrity checking. 


Alternatively, you can calculate the new hash for all the modified files and update them in the *service-worker-assets.js* file. You can calculate the hash with with these PowerShell commands:

<pre style="color:#000000;background:#ffffff;">$Signature = Get-FileHash -Path <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">path/to/your/file</span><span style="color:#2a00ff; ">"</span> -Algorithm <span style="color:#2a00ff; ">SHA256</span>&#10;$SignatureBytes = <span style="color:#7f0055; font-weight:bold; ">[byte[]]</span> -split ($Signature.Hash <span style="color:#7f0055; font-weight:bold; ">-replace</span> <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">.</span><span style="color:#2a00ff; ">.</span><span style="color:#2a00ff; ">'</span>, <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">0x$&amp; </span><span style="color:#2a00ff; ">'</span>)&#10;$SignatureBase64 = <span style="color:#7f0055; font-weight:bold; ">[System.Convert]</span>::ToBase64String($SignatureBytes)&#10;$NewHash = <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">sha256-</span><span style="color:#2a00ff; ">$SignatureBase64</span><span style="color:#2a00ff; ">"</span>&#10;Write-Host $NewHash&#10;</pre>

Alternatively, you can use openssl to generate the hash in bash:

<pre style="color:#000000;background:#ffffff;"><span style="color:#7f0055; font-weight:bold; ">echo</span> <span style="color:#2a00ff; ">"sha256-$(openssl dgst -sha256 -binary </span><span style="color:#2a00ff; ">\\</span><span style="color:#2a00ff; ">path</span><span style="color:#2a00ff; ">\\</span><span style="color:#2a00ff; ">to</span><span style="color:#2a00ff; ">\\</span><span style="color:#2a00ff; ">your</span><span style="color:#2a00ff; ">\\</span><span style="color:#2a00ff; ">file | openssl base64 -A)"</span>&#10;</pre>




Manually going over each file and updating the hash in the *service-worker-assets.js* file can be painful, so here's a PowerShell script and a Bash script that will iterate over every file listed in *service-worker-assets.js*.<br>If the hash is different, the hash is automatically updated in *service-worker-assets.js*:


PowerShell:

<pre style="color:#000000;background:#ffffff;"><span style="color:#3f7f59; "># make sure you're in the wwwroot folder of the published application</span>&#10;$JsFileContent = Get-Content -Path service-worker-assets<span style="color:#7f0055; font-weight:bold; ">.</span>js -Raw&#10;<span style="color:#3f7f59; "># remove JavaScript from contents so it can be interpreted as JSON</span>&#10;$Json = $JsFileContent.Replace(<span style="color:#2a00ff; ">"self.assetsManifest = "</span>, <span style="color:#2a00ff; ">""</span>)<span style="color:#7f0055; font-weight:bold; ">.</span>Replace(<span style="color:#2a00ff; ">";"</span>, <span style="color:#2a00ff; ">""</span>) | ConvertFrom-Json&#10;<span style="color:#3f7f59; "># grab the assets JSON array</span>&#10;$Assets = $Json.assets&#10;foreach ($Asset <span style="color:#7f0055; font-weight:bold; ">in</span> $Assets) {&#10;  $OldHash = $Asset.hash&#10;  $Path = $Asset.url&#10;  &#10;  $Signature = Get-FileHash -Path $Path -Algorithm SHA256&#10;  $SignatureBytes = <span style="color:#2a00ff; ">[</span><span style="color:#2a00ff; ">byte[]</span><span style="color:#2a00ff; ">]</span> -split ($Signature.Hash -replace <span style="color:#2a00ff; ">'..'</span>, <span style="color:#2a00ff; ">'0x$&amp; '</span>)&#10;  $SignatureBase64 = <span style="color:#2a00ff; ">[</span><span style="color:#2a00ff; ">System.Convert</span><span style="color:#2a00ff; ">]</span>::ToBase64String($SignatureBytes)&#10;  $NewHash = <span style="color:#2a00ff; ">"sha256-</span><span style="color:#2a00ff; ">$SignatureBase64</span><span style="color:#2a00ff; ">"</span>&#10;  &#10;  If ($OldHash -ne $NewHash) {&#10;    Write-Host <span style="color:#2a00ff; ">"Updating hash for </span><span style="color:#2a00ff; ">$Path</span><span style="color:#2a00ff; "> from </span><span style="color:#2a00ff; ">$OldHash</span><span style="color:#2a00ff; "> to </span><span style="color:#2a00ff; ">$NewHash</span><span style="color:#2a00ff; ">"</span>&#10;    <span style="color:#3f7f59; "># slashes are escaped in the js-file, but PowerShell unescapes them automatically,</span>&#10;    <span style="color:#3f7f59; "># we need to re-escape them</span>&#10;    $OldHash = $OldHash.Replace(<span style="color:#2a00ff; ">"</span><span style="color:#3f3fbf; ">/</span><span style="color:#2a00ff; ">"</span>, <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">\/</span><span style="color:#2a00ff; ">"</span>)&#10;    $NewHash = $NewHash.Replace(<span style="color:#2a00ff; ">"</span><span style="color:#3f3fbf; ">/</span><span style="color:#2a00ff; ">"</span>, <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">\/</span><span style="color:#2a00ff; ">"</span>)&#10;    $JsFileContent = $JsFileContent.Replace(<span style="color:#2a00ff; ">""</span><span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$OldHash</span><span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">""</span>, <span style="color:#2a00ff; ">""</span><span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$NewHash</span><span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">""</span>)&#10;  }&#10;}&#10;&#10;Set-Content -Path service-worker-assets<span style="color:#7f0055; font-weight:bold; ">.</span>js -Value $JsFileContent -NoNewline&#10;</pre>

Bash:

<pre style="color:#000000;background:#ffffff;"><span style="color:#3f7f59; ">#!</span>/bin/bash&#10;<span style="color:#3f7f59; "># make sure you're in the wwwroot folder of the published application</span>&#10;jsFile=$(&lt;service-worker-assets<span style="color:#7f0055; font-weight:bold; ">.</span>js)&#10;<span style="color:#3f7f59; "># remove JavaScript from contents so it can be interpreted as JSON</span>&#10;json=$(<span style="color:#7f0055; font-weight:bold; ">echo</span> <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$jsFile</span><span style="color:#2a00ff; ">"</span> | <span style="color:#7f0055; font-weight:bold; ">sed</span> <span style="color:#2a00ff; ">"</span><span style="color:#7f0055; font-weight:bold; ">s</span><span style="color:#2a00ff; ">/</span><span style="color:#2a00ff; ">self</span><span style="color:#2a00ff; ">.</span><span style="color:#2a00ff; ">assetsManifest = </span><span style="color:#2a00ff; ">/</span><span style="color:#2a00ff; ">/</span><span style="color:#7f0055; font-weight:bold; ">g</span><span style="color:#2a00ff; ">"</span> | <span style="color:#7f0055; font-weight:bold; ">sed</span> <span style="color:#2a00ff; ">"</span><span style="color:#7f0055; font-weight:bold; ">s</span><span style="color:#2a00ff; ">/</span><span style="color:#2a00ff; ">;</span><span style="color:#2a00ff; ">/</span><span style="color:#2a00ff; ">/</span><span style="color:#7f0055; font-weight:bold; ">g</span><span style="color:#2a00ff; ">"</span>)&#10;<span style="color:#3f7f59; "># grab the assets JSON array</span>&#10;assets=$(<span style="color:#7f0055; font-weight:bold; ">echo</span> <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$json</span><span style="color:#2a00ff; ">"</span> | jq <span style="color:#2a00ff; ">'.assets[]'</span> -c)&#10;<span style="color:#7f0055; font-weight:bold; ">for</span> asset <span style="color:#7f0055; font-weight:bold; ">in</span> $assets&#10;<span style="color:#7f0055; font-weight:bold; ">do</span>&#10;  oldHash=$(<span style="color:#7f0055; font-weight:bold; ">echo</span> <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$asset</span><span style="color:#2a00ff; ">"</span> | jq <span style="color:#2a00ff; ">'.hash'</span>)&#10;  <span style="color:#3f7f59; ">#remove leading and trailing quotes</span>&#10;  oldHash=<span style="color:#2a00ff; ">"${oldHash:1:-1}"</span>&#10;  path=$(<span style="color:#7f0055; font-weight:bold; ">echo</span> <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$asset</span><span style="color:#2a00ff; ">"</span> | jq <span style="color:#2a00ff; ">'.url'</span>)&#10;  <span style="color:#3f7f59; ">#remove leading and trailing quotes</span>&#10;  path=<span style="color:#2a00ff; ">"${path:1:-1}"</span>&#10;  newHash=<span style="color:#2a00ff; ">"sha256-$(openssl dgst -sha256 -binary </span><span style="color:#2a00ff; ">$path</span><span style="color:#2a00ff; "> | openssl base64 -A)"</span>&#10;  &#10;  <span style="color:#7f0055; font-weight:bold; ">if</span> [ $oldHash != $newHash ]; <span style="color:#7f0055; font-weight:bold; ">then</span>&#10;    <span style="color:#3f7f59; "># escape slashes for json</span>&#10;    oldHash=$(<span style="color:#7f0055; font-weight:bold; ">echo</span> <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$oldHash</span><span style="color:#2a00ff; ">"</span> | <span style="color:#7f0055; font-weight:bold; ">sed</span> <span style="color:#2a00ff; ">'</span><span style="color:#7f0055; font-weight:bold; ">s</span><span style="color:#2a00ff; ">;</span><span style="color:#2a00ff; ">/</span><span style="color:#2a00ff; ">;</span><span style="color:#2a00ff; ">\\</span><span style="color:#2a00ff; ">/</span><span style="color:#2a00ff; ">;</span><span style="color:#7f0055; font-weight:bold; ">g</span><span style="color:#2a00ff; ">'</span>)&#10;    newHash=$(<span style="color:#7f0055; font-weight:bold; ">echo</span> <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$newHash</span><span style="color:#2a00ff; ">"</span> | <span style="color:#7f0055; font-weight:bold; ">sed</span> <span style="color:#2a00ff; ">'</span><span style="color:#7f0055; font-weight:bold; ">s</span><span style="color:#2a00ff; ">;</span><span style="color:#2a00ff; ">/</span><span style="color:#2a00ff; ">;</span><span style="color:#2a00ff; ">\\</span><span style="color:#2a00ff; ">/</span><span style="color:#2a00ff; ">;</span><span style="color:#7f0055; font-weight:bold; ">g</span><span style="color:#2a00ff; ">'</span>)&#10;    <span style="color:#7f0055; font-weight:bold; ">echo</span> <span style="color:#2a00ff; ">"Updating hash for </span><span style="color:#2a00ff; ">$path</span><span style="color:#2a00ff; "> from </span><span style="color:#2a00ff; ">$oldHash</span><span style="color:#2a00ff; "> to </span><span style="color:#2a00ff; ">$newHash</span><span style="color:#2a00ff; ">"</span>&#10;    <span style="color:#3f7f59; "># escape slashes second time for sed</span>&#10;    oldHash=$(<span style="color:#7f0055; font-weight:bold; ">echo</span> <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$oldHash</span><span style="color:#2a00ff; ">"</span> | <span style="color:#7f0055; font-weight:bold; ">sed</span> <span style="color:#2a00ff; ">'</span><span style="color:#7f0055; font-weight:bold; ">s</span><span style="color:#2a00ff; ">;</span><span style="color:#2a00ff; ">/</span><span style="color:#2a00ff; ">;</span><span style="color:#2a00ff; ">\\</span><span style="color:#2a00ff; ">/</span><span style="color:#2a00ff; ">;</span><span style="color:#7f0055; font-weight:bold; ">g</span><span style="color:#2a00ff; ">'</span>)&#10;    jsFile=$(<span style="color:#7f0055; font-weight:bold; ">echo</span> -n <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$jsFile</span><span style="color:#2a00ff; ">"</span> | <span style="color:#7f0055; font-weight:bold; ">sed</span> <span style="color:#2a00ff; ">"</span><span style="color:#7f0055; font-weight:bold; ">s</span><span style="color:#2a00ff; ">;</span><span style="color:#2a00ff; ">$</span><span style="color:#2a00ff; ">oldHash</span><span style="color:#2a00ff; ">;</span><span style="color:#2a00ff; ">$newHash</span><span style="color:#2a00ff; ">;</span><span style="color:#7f0055; font-weight:bold; ">g</span><span style="color:#2a00ff; ">"</span>)&#10;  <span style="color:#7f0055; font-weight:bold; ">fi</span>&#10;<span style="color:#7f0055; font-weight:bold; ">done</span>&#10;&#10;<span style="color:#7f0055; font-weight:bold; ">echo</span> -n <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$jsFile</span><span style="color:#2a00ff; ">"</span> &gt; service-worker-assets<span style="color:#7f0055; font-weight:bold; ">.</span>js&#10;</pre>




The Current Working Directory (CWD) has to be at the *wwwroot* folder of the published application. You can now integrate these scripts into your build process or continuous integration pipeline, as done in <a rel="noopener" href="https://github.com/Swimburger/BlazorGitHubPagesDemo/blob/pwa/.github/workflows/pwa.yml" target="_blank">this GitHub Actions workflow</a>:




<pre style="color:#000000;background:#ffffff;">name: Deploy to GitHub Pages&#10;&#10;# Run workflow on every push to the master branch&#10;on:&#10;  push:&#10;    branches: [ pwa ]&#10;&#10;jobs:&#10;  deploy-to-github-pages:&#10;    # use ubuntu-latest image to run steps on&#10;    runs-on: ubuntu-latest&#10;    steps:&#10;    # uses GitHub<span style="color:#2a00ff; ">'</span>s checkout action to checkout code form the master branch&#10;    - uses: actions/checkout@v2&#10;    &#10;    # sets up .NET Core SDK 5.0.101&#10;    - name: Setup .NET Core SDK&#10;      uses: actions/setup-dotnet@v1&#10;      with:&#10;        dotnet-version: 5.0.101&#10;&#10;    # publishes Blazor project to the release-folder&#10;    - name: Publish .NET Core Project&#10;      run: dotnet publish BlazorGitHubPagesDemo.csproj -c Release -o release --nologo&#10;    &#10;    # changes the base-tag in index.html from <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">/</span><span style="color:#2a00ff; ">'</span> to <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">BlazorGitHubPagesDemo</span><span style="color:#2a00ff; ">'</span> to match GitHub Pages repository subdirectory&#10;    - name: Change base-tag in index.html from / to BlazorGitHubPagesDemo&#10;      run: sed -i <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">s/&lt;base href="\/" \/&gt;/&lt;base href="\/BlazorGitHubPagesDemo\/" \/&gt;/g</span><span style="color:#2a00ff; ">'</span> release/wwwroot/index.html&#10;&#10;    # changes the base-tag in index.html from <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">/</span><span style="color:#2a00ff; ">'</span> to <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">BlazorGitHubPagesDemo</span><span style="color:#2a00ff; ">'</span> to match GitHub Pages repository subdirectory&#10;    - name: Fix service-worker-assets.js hashes&#10;      working-directory: release/wwwroot&#10;      run: |&#10;        jsFile=$(&lt;service-worker-assets.js)&#10;        # remove JavaScript from contents so it can be interpreted as JSON&#10;        json=$(echo <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$jsFile</span><span style="color:#2a00ff; ">"</span> | sed <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">s/self.assetsManifest = //g</span><span style="color:#2a00ff; ">"</span> | sed <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">s/;//g</span><span style="color:#2a00ff; ">"</span>)&#10;        # grab the assets JSON array&#10;        assets=$(echo <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$json</span><span style="color:#2a00ff; ">"</span> | jq <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">.assets[]</span><span style="color:#2a00ff; ">'</span> -c)&#10;        for asset in $assets&#10;        do&#10;          oldHash=$(echo <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$asset</span><span style="color:#2a00ff; ">"</span> | jq <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">.hash</span><span style="color:#2a00ff; ">'</span>)&#10;          #remove leading and trailing quotes&#10;          oldHash=<span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">${oldHash:1:-1}</span><span style="color:#2a00ff; ">"</span>&#10;          path=$(echo <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$asset</span><span style="color:#2a00ff; ">"</span> | jq <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">.url</span><span style="color:#2a00ff; ">'</span>)&#10;          #remove leading and trailing quotes&#10;          path=<span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">${path:1:-1}</span><span style="color:#2a00ff; ">"</span>&#10;          newHash=<span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">sha256-$(openssl dgst -sha256 -binary $path | openssl base64 -A)</span><span style="color:#2a00ff; ">"</span>&#10;          &#10;          if [ $oldHash != $newHash ]; then&#10;            # escape slashes for json&#10;            oldHash=$(echo <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$oldHash</span><span style="color:#2a00ff; ">"</span> | sed <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">s;/;\\/;g</span><span style="color:#2a00ff; ">'</span>)&#10;            newHash=$(echo <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$newHash</span><span style="color:#2a00ff; ">"</span> | sed <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">s;/;\\/;g</span><span style="color:#2a00ff; ">'</span>)&#10;            echo <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">Updating hash for $path from $oldHash to $newHash</span><span style="color:#2a00ff; ">"</span>&#10;            # escape slashes second time for sed&#10;            oldHash=$(echo <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$oldHash</span><span style="color:#2a00ff; ">"</span> | sed <span style="color:#2a00ff; ">'</span><span style="color:#2a00ff; ">s;/;\\/;g</span><span style="color:#2a00ff; ">'</span>)&#10;            jsFile=$(echo -n <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$jsFile</span><span style="color:#2a00ff; ">"</span> | sed <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">s;$oldHash;$newHash;g</span><span style="color:#2a00ff; ">"</span>)&#10;          fi&#10;        done&#10;&#10;        echo -n <span style="color:#2a00ff; ">"</span><span style="color:#2a00ff; ">$jsFile</span><span style="color:#2a00ff; ">"</span> &gt; service-worker-assets.js&#10;    &#10;    # copy index.html to 404.html to serve the same file when a file is not found&#10;    - name: copy index.html to 404.html&#10;      run: cp release/wwwroot/index.html release/wwwroot/404.html&#10;&#10;    # add .nojekyll file to tell GitHub pages to not treat this as a Jekyll project. (Allow files and folders starting with an underscore)&#10;    - name: Add .nojekyll file&#10;      run: touch release/wwwroot/.nojekyll&#10;      &#10;    - name: Commit wwwroot to GitHub Pages&#10;      uses: JamesIves/<span style="color:#3f3fbf; ">github-pages-deploy-action@3.7.1</span>&#10;      with:&#10;        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}&#10;        BRANCH: gh-pages&#10;        FOLDER: release/wwwroot&#10;</pre>

Hopefully this helps and saves you some valuable time, cheers!
