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

docker.yml: Set persist-credentials: false #7506

Merged
merged 1 commit into from
May 4, 2020
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
7 changes: 3 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ jobs:
uses: actions/checkout@master
with:
fetch-depth: 0
- name: Configure Git
run: |
git config --unset "http.https://github.com/.extraheader"
git fetch origin master
persist-credentials: false
- name: Fetch origin/master from Git
run: git fetch origin master
Copy link
Member

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?

Copy link
Contributor

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

Copy link
Member

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

Copy link
Contributor Author

@sjackman sjackman May 5, 2020

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.

Copy link
Member

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 fetches.

Copy link
Contributor Author

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

- name: Build Docker image
run: docker build -t brew --build-arg=version=${{matrix.version}} .
- name: Run brew test-bot
Expand Down