-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
docker.yml: Set persist-credentials: false #7506
Conversation
git fetch origin master | ||
persist-credentials: false | ||
- name: Fetch origin/master from Git | ||
run: git fetch origin master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are actions/checkout
and git fetch origin master
both needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe it fetches branch refs, even with fetch-depth: 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case I'd suggest doing something like this: https://github.com/actions/checkout#Fetch-all-branches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? We don't need all branches, just origin/master
. I prefer the simplest command that does the job. I'm addressing this specific error:
$ docker run -it --rm docker.pkg.github.com/homebrew/brew/ubuntu20.04:2.2.15
$ brew update
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+refs/heads/#{ENV["GITHUB_BASE_REF"]}
is the refspec you want. It would be nice to combine that with the normal fetch for actions/checkout to avoid running two git fetch
es.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git fetch origin master
takes 1.36s, so it doesn't seem worth optimizing to me.
actions/checkout
does not currently support fetching multiple references. There's an open issue. actions/checkout#214
brew style
with your changes locally?brew tests
with your changes locally?Aesthetic change only.