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

all: fix ci ref_protected check for caching #4254

Merged
merged 2 commits into from
Mar 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ runs:
# rebuilds and cause test runs to skip tests that have no reason to rerun.
# Don't run this for protected branches like master/main.
- uses: actions/cache@v2
if: github.ref_protected || github.ref != 'refs/heads/master'
if: (!github.ref_protected) && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we use the main branch? Otherwise that's unnecessary. I also don't think we need parentheses.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't, although we did discuss transitioning at some point. No harm in adding it though. Same with the parentheses, I can never remember the typical order of precedence.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It adds noise. If we ever use main, then we will change it

with:
path: ~/.cache/go-build
key: ${{ env.PREFIX }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }}
Expand Down