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

Documented save-if: ${{ github.ref == 'refs/head/master' }} does not work. #165

Closed
rukai opened this issue Aug 24, 2023 · 1 comment · Fixed by #166
Closed

Documented save-if: ${{ github.ref == 'refs/head/master' }} does not work. #165

rukai opened this issue Aug 24, 2023 · 1 comment · Fixed by #166

Comments

@rukai
Copy link
Contributor

rukai commented Aug 24, 2023

After reading the readme, I added save-if: ${{ github.ref == 'refs/head/main' }} (we use main instead of master) to my workflow in order to only cache from the main branch.
However now the workflow is never cached regardless of if it is running on the main branch or on a PR.
Here is an example run on the main branch: https://github.com/shotover/shotover-proxy/actions/runs/5958570260/job/16162971043
It fetches an old cache from before I added the save-if but then in the post-run it doesnt write to the cache.

So it appears the documentation is wrong or the feature is broken.

@rukai
Copy link
Contributor Author

rukai commented Aug 24, 2023

I found the documentation for github.ref
It says the syntax is refs/heads/<branch_name> instead of refs/head/<branch_name>!
I'll make a PR to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant