Skip to content

Instantly share code, notes, and snippets.

@kgriffs
Created January 16, 2024 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kgriffs/50b7c490e0f28443481b9d1ec528c657 to your computer and use it in GitHub Desktop.
Save kgriffs/50b7c490e0f28443481b9d1ec528c657 to your computer and use it in GitHub Desktop.
Github Action (GHA) caching a downloaded file example
- name: Cache downloaded file
id: cache-some-file
uses: actions/cache@v3
with:
path: some-file
key: ${{ runner.os }}-downloaded-file-${{ hashFiles('some-file') }}
- name: Fetch smctl MSI
if: steps.cache-some-file.outputs.cache-hit != 'true'
shell: pwsh
run: |
Invoke-WebRequest -Uri https://example.com/some-file -OutFile some-file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment