Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add private github package support using personal access token #152

Merged
merged 3 commits into from
Nov 3, 2021

Conversation

rYuuk
Copy link
Contributor

@rYuuk rYuuk commented Oct 28, 2021

Changes

Checklist

  • Read the contribution guide and accept the code of conduct
  • Readme (updated or not needed)
  • Tests (added, updated or not needed)

@webbertakken I tried getting all the changes from the above mentioned PR. I am not really sure if its complete.
I am not good with js, so I wasn't able to fix the test failing and linting issues. It would be great if I could get some help.

@github-actions
Copy link

Cat Gif

@rYuuk rYuuk changed the title add private github package support using pat add private github package support using personal access token Oct 28, 2021
@webbertakken
Copy link
Member

webbertakken commented Oct 28, 2021

The unit tests passed.

The distributable files weren't created however. You you will have to follow the steps from CONTRIBUTING.md about sending a pull request.

If you run yarn, it should install husky. husky will create a pre-commit hook, and the hook will run yarn build for you.

Could you please verify that using unity-test-runner with these changes works in your workflow? You can use unity-test-runner@<gitcommithash> to use the exact version of your latest commit.

@rYuuk
Copy link
Contributor Author

rYuuk commented Oct 28, 2021

I gave it a try on our repo and looks like it seems to work a bit, but I got this error

Project has invalid dependencies:
Error when executing git command. remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.

Not really sure why it says that, I am not using any password and instead using a personal access token from one of the owner account of the organizations.

@rYuuk rYuuk marked this pull request as ready for review October 29, 2021 11:17
@webbertakken webbertakken merged commit 576ef39 into game-ci:main Nov 3, 2021
@shubear
Copy link

shubear commented Jan 4, 2022

In relation to #136, this change may have broken any existing repo's using ssh. Our manifest uses ssh://git@github.com and this is the output I am seeing

Activation complete.
/github/workspace
/steps/set_gitcredential.sh: line 1: #!/usr/bin/env: No such file or directory
GIT_PRIVATE_TOKEN is set configuring git credentials
---------- git config --list -------------
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true

This is what my action config looks like

- uses: game-ci/unity-test-runner@v2
   with:
          sshAgent: ${{ env.SSH_AUTH_SOCK }}

@shubear
Copy link

shubear commented Jan 4, 2022

I noted this in the logs

 --env GIT_PRIVATE_TOKEN=undefined 

Even though this is what my action looks like

      - uses: game-ci/unity-test-runner@v2
        with:
          sshAgent: ${{ env.SSH_AUTH_SOCK }}
          gitPrivateToken: ''

@shubear
Copy link

shubear commented Jan 4, 2022

working around this issue by using - uses: game-ci/unity-test-runner@v2.0-alpha-6, incase anyone is facing this

@davidmfinol
Copy link
Member

working around this issue by using - uses: game-ci/unity-test-runner@v2.0-alpha-6, incase anyone is facing this

@shubear Can you try - uses: game-ci/unity-test-runner@main and see if that works for you? I believe the regression may be fixed by a change I recently made that hasn't been rolled into v2 yet.

@ghost
Copy link

ghost commented Jan 5, 2022

Running this with game-ci/unity-test-runner@main shows the same issue for me. Running with game-ci/unity-test-runner@v2.0-alpha-6 doesn't trigger the issue.

@davidmfinol
Copy link
Member

Hm... with v2, I get logs that match the initial error scenario:

Activation complete.
/github/workspace
/steps/set_gitcredential.sh: line 1: #!/usr/bin/env: No such file or directory
GIT_PRIVATE_TOKEN is set configuring git credentials

But with main, I get this:

Activation complete.
/github/workspace
/steps/set_gitcredential.sh: line 1: #!/usr/bin/env: No such file or directory
GIT_PRIVATE_TOKEN unset skipping

You still get the GIT_PRIVATE_TOKEN is set configuring git credentials message even with game-ci/unity-test-runner@main?

@ghost
Copy link

ghost commented Jan 10, 2022

Hm... with v2, I get logs that match the initial error scenario:

Activation complete.
/github/workspace
/steps/set_gitcredential.sh: line 1: #!/usr/bin/env: No such file or directory
GIT_PRIVATE_TOKEN is set configuring git credentials

But with main, I get this:

Activation complete.
/github/workspace
/steps/set_gitcredential.sh: line 1: #!/usr/bin/env: No such file or directory
GIT_PRIVATE_TOKEN unset skipping

You still get the GIT_PRIVATE_TOKEN is set configuring git credentials message even with game-ci/unity-test-runner@main?

No, I don't. I was only referring to the /steps/set_gitcredential.sh: line 1: #!/usr/bin/env: No such file or directory error on main. I haven't seen the GIT_PRIVATE_TOKEN is set configuring git credentials message at all, AFAICT. Sorry for not being clearer.

@davidmfinol
Copy link
Member

I think we can safely ignore the /steps/set_gitcredential.sh: line 1: #!/usr/bin/env: No such file or directory message.
The issue I'm worried about is being unable to access git private repos with sshAgent.
If you're seeing a problem with sshAgent, can you update on #157 ?

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

Successfully merging this pull request may close these issues.

5 participants