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

Provide option to only configure auth #234

Open
btashton opened this issue May 5, 2020 · 3 comments
Open

Provide option to only configure auth #234

btashton opened this issue May 5, 2020 · 3 comments

Comments

@btashton
Copy link

btashton commented May 5, 2020

I'm facing an issue where I have a git repo passed via an artifact or cache from another job in the workflow. I need to be able to run git command on this including pulling tags, but the auth does not seem to travel with it (even with persist enabled [worked at one point but not now]). I do not want to go through the process of checking out the repo and especially want to keep the ref as it is.

Right now I have to do something like this:

      - name: Export  Repo SHA
        run:  echo "::set-env name=rep_sha::`git -C sources/myrepo rev-parse HEAD`"
      - name: Refresh Git Credentials
        uses: actions/checkout@v2
        with:
          repository: org/repo
          ref: ${{ env.repo_sha }}
          path: sources/myrep
          fetch-depth: 1
      - name: Get Tags for Repo
        run: git -C sources/myrepo fetch --tags

Doing this still causes it to reach out via the checkout action and it requires me to fetch the rev in the previous step.

@ericsciple
Copy link
Contributor

It should be pretty cheap to fetch, since all of the git objects already exist?

@btashton
Copy link
Author

btashton commented Jun 1, 2020

@ericsciple unfortunately there is a lot more that goes on including things like Removing previously created refs, to avoid conflicts This whole flow adds 10's of seconds for no reason.

@btashton
Copy link
Author

btashton commented Sep 2, 2020

@ericsciple in our larger repo this is getting annoying because all the refs are getting "cleaned" and have to be pulled again.
This flow is now up to 90sec for something I would expect to be nearly free.

Run actions/checkout@v2
Syncing repository: apache/incubator-nuttx
Getting Git version info
/usr/local/bin/git config --local --get remote.origin.url
https://github.com/apache/incubator-nuttx
Removing previously created refs, to avoid conflicts
Cleaning the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
Determining the checkout info
Checking out the ref
/usr/local/bin/git log -1

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

No branches or pull requests

2 participants