Visitar URL original
Update "Restrictions for accessing a cache" - make clear that cache entries are shared between workflows by magnetikonline · Pull Request #9311 · github/docs · GitHub
The Wayback Machine - https://web.archive.org/web/20210825175758/https://github.com/github/docs/pull/9311
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update "Restrictions for accessing a cache" - make clear that cache entries are shared between workflows #9311

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

@magnetikonline
Copy link
Contributor

@magnetikonline magnetikonline commented Aug 25, 2021 •

Why:

Closes #9310

Here are the two example workflows used (in the same repository of course) to prove this:

name: One

on:
  push:

jobs:
  one:
    runs-on: ubuntu-latest
    steps:
      - run: |
          echo "workflow-one-item" >cache.me
      - uses: actions/cache@v2
        with:
          path: |
            cache.me
          key: cache-key-01
name: Two

on:
  push:

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/cache@v2
        with:
          path: |
            cache.me
          key: cache-key-01
      - run: |
          cat cache.me

So basically, triggering workflow One will populate a new cache entry of cache-key-01. Executing Two afterwards will happily pull the cache-key-01 with the contents workflow-one-item right away. There is no isolation or namespacing between the workflows.

I think this is good to know and can be a powerful item for the toolkit - but also could be causing troubles for some if taking the current documentation as absolute.

What's being changed:

Clearing up the documentation around Restrictions for accessing a cache to make it clear that sharing of cache entries between workflows within the same repository for the same branch is very much possible.

This is the key line I've added:

Multiple workflows within a repository share cache entries. A cache created for a branch within a workflow can be accessed and restored from another workflow for the same repository and branch.

Check off the following:

  • I have reviewed my changes in staging (look for the latest deployment event in your pull request's timeline, then click View deployment).
  • For content changes, I have completed the self-review checklist.

Writer impact (This section is for GitHub staff members only):

  • This pull request impacts the contribution experience
    • I have added the 'writer impact' label
    • I have added a description and/or a video demo of the changes below (e.g. a "before and after video")
@deploy-to-heroku deploy-to-heroku bot temporarily deployed to docs-9311--fix-restrictions-ac Aug 25, 2021 Inactive
@github-actions github-actions bot added this to Triage in Docs team reviews Aug 25, 2021
@magnetikonline magnetikonline force-pushed the magnetikonline:fix-restrictions-access-cache-workflow branch from 0212b23 to df42f94 Aug 25, 2021
@deploy-to-heroku deploy-to-heroku bot temporarily deployed to docs-9311--fix-restrictions-ac Aug 25, 2021 Inactive
…entries created in one workflow are accessable for another, for the same branch
@magnetikonline magnetikonline force-pushed the magnetikonline:fix-restrictions-access-cache-workflow branch from df42f94 to 26a737f Aug 25, 2021
@ramyaparimi ramyaparimi moved this from Triage to Content review needed in Docs team reviews Aug 25, 2021
@ramyaparimi ramyaparimi moved this from Content review needed to Triage in Docs team reviews Aug 25, 2021
@ramyaparimi ramyaparimi moved this from Triage to Content review needed in Docs team reviews Aug 25, 2021
@ramyaparimi
Copy link
Collaborator

@ramyaparimi ramyaparimi commented Aug 25, 2021

@magnetikonline
Thanks so much for opening a PR! I'll get this triaged for review ⚡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Docs team reviews
Content review needed
Linked issues

Successfully merging this pull request may close these issues.

2 participants