Skip to content

Commit

Permalink
Cache per branch (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShakedZrihen authored Mar 30, 2023
1 parent bf380bc commit 2e71de8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ runs:
uses: actions/cache@v3
with:
path: gitstream
key: ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).headSha }}-${{ fromJSON(fromJSON(github.event.inputs.client_payload)).repo }}-gitsream-cache
key: ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).repo }}-gitsream-cache

- name: Create GitStream folder
## this step will be skipped if cache exists
Expand Down Expand Up @@ -75,6 +75,17 @@ runs:
shell: bash
if: ${{ steps.cache-gitstream.outputs.cache-hit != 'true' }}
- name: Configure Git
shell: bash
env:
GITHUB_TOKEN: ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).githubToken || github.token }}
run: |
cd gitstream
cd repo
git stash
gh pr checkout ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).pullRequestNumber }}
if: ${{ steps.cache-gitstream.outputs.cache-hit == 'true' }}

- name: Create cm folder
## this step will be skipped if cache exists
if: ${{ steps.cache-gitstream.outputs.cache-hit != 'true' }}
Expand Down

0 comments on commit 2e71de8

Please sign in to comment.