https://github.com/taskworld/job-cache-action
GitHub Action for caching job status
https://github.com/taskworld/job-cache-action
Last synced: 11 months ago
JSON representation
GitHub Action for caching job status
- Host: GitHub
- URL: https://github.com/taskworld/job-cache-action
- Owner: taskworld
- Created: 2023-10-19T08:39:10.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-02T06:26:09.000Z (over 2 years ago)
- Last Synced: 2025-02-06T20:39:56.197Z (about 1 year ago)
- Language: TypeScript
- Size: 1.55 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This action is similar to [actions/cache](https://github.com/actions/cache) but it also saves the current [`job.status`](https://docs.github.com/en/actions/learn-github-actions/contexts#job-context) (**success** or **failure**) and restores it in a later run when the same `cache-key` hits.
This offers two separate actions `taskworld/job-cache-action/save` and `taskworld/job-cache-action/restore` due to the limitations of how job status is derived in JavaScript action.
## Usage example
```yml
on:
pull_request:
jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: cache
uses: taskworld/job-cache-action/restore@v1
with:
cache-key: build-${{ hashFiles('src') }}
path: pass-your-additional-files-here
- runs: npx eslint
- uses: taskworld/job-cache-action/save@v1
with:
cache-key: ${{ steps.cache.outputs.cache-key }}
path: pass-your-additional-files-here
```