Skip to content

Conversation

@msiebeneicher
Copy link
Contributor

Description

Close #238

With this PR gh will be used to authenticate the repository by the used GITHUB_TOKEN.

This change is tested against GitHub Enterprise v3.5. It would be lovely if you could test it also against your setup on github.com.

Copy link
Owner

@AndreasAugustin AndreasAugustin left a comment

Choose a reason for hiding this comment

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

Hi @msiebeneicher
Finally I was able to test the gh auth login --with_token call. When no token is provided, it will give an error.

Screenshot from 2022-12-18 16-02-10

Therefore I like to request some small adjustments. Would be super nice if you could do those :)

  • please add another optional parameter for the action source_repo_github_token
  • check in the entrypoint.sh the existence, if it exists, init gh auth with your current PR commands

This will also enable your use case with your example with

      - name: actions-template-sync
        uses: AndreasAugustin/[email protected]
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          source_repo_github_token: ${{ steps.generate_token.outputs.token }}
          source_repo_path: <owner/repo>

Furthermore it would be lovely if you could also update the docs/ARCHITECTURE.md mermaid diagram (if possible 👍 )

Remark:

  • There is a possible case that both variables are existend: ssh private key and github token. In this case the github token should be prefered (I think).
  • I will afterwards add automated regression tests

Thanks a bunch for this.

@AndreasAugustin AndreasAugustin added the enhancement New feature or request label Dec 18, 2022
@msiebeneicher msiebeneicher force-pushed the feat/use_gh_auth_for_authentication branch from 5ca615f to 8c71aeb Compare December 23, 2022 10:16
@msiebeneicher
Copy link
Contributor Author

msiebeneicher commented Dec 23, 2022

@AndreasAugustin : requested and discussed changes are now implemented. Would be nice if you can test the changes for your ssh setup again.

@AndreasAugustin
Copy link
Owner

@AndreasAugustin : requested and discussed changes are now implemented. Would be nice if you can test the changes for your ssh setup again.

@AndreasAugustin : requested and discussed changes are now implemented. Would be nice if you can test the changes for your ssh setup again.

@msiebeneicher thanks for the changes.
It seems that they do not work for ssh setup. I will think about a solution.

image

@AndreasAugustin
Copy link
Owner

@all-contributors
please add @msiebeneicher for code and doc

@allcontributors
Copy link
Contributor

@AndreasAugustin

I've updated the pull request to add @msiebeneicher! 🎉

Marc Siebeneicher and others added 8 commits January 1, 2023 17:52
fix(): small fix for private repos 🐛
# This is the 1st commit message:

parent 9b74224
author Andy Augustin <[email protected]> 1672219390 +0100
committer Andy Augustin <[email protected]> 1672592292 +0100
gpgsig -----BEGIN PGP SIGNATURE-----

 iQGzBAABCAAdFiEEApgnwt2TStNZl6Y9UpE0XzZ/UkgFAmOxu6QACgkQUpE0XzZ/
 UkjAzgv/cWh9hE7VLkLM1nVmra945WUkOfWXHnCUnrsOWsxxSOkH1r2mLxZdnWtg
 BlFc4RciJAB39Nv1WBUt+hGBGOdYWcV1lxgSIpn+vNXd9/5xciEThRk9T1piHj+x
 xnZU2rW0dLlnEnFlIX1qkKeD+rjclXw46umjMgqwIF0vQSx5cR9y8sDCiqRGg2Fv
 G/k/xLoQwah0Ve8nwqd6dLwNYXl8cFBfvuZaGV/dt1+5BDl4J5mPYg4trxKx5xnB
 fTxTQ0G/qOa1OInW04EReJWZwQaGvyx5PqEFk0ESk8MuzFytfVVRCnHwdP/QvLO7
 S7Y79wUBAQfHvSlwOgBtlQc5eFOiKoxahUhJIcCMLw1r2+nRjuPAA0j07v6nmjDM
 sfxyVSpnYnKGAfGrYGboOHuEjqKegKdY3oIQFL/Ivln7kmLxGrFcpQ+QMTEJUsLw
 2AB+Yf+tJyQXnx8AiGQRnVlXW3FRCOQhCxK2zXMUpzwAsKcKYNnaKoM6jDN7EzRQ
 fZrB76EK
 =yGb3
 -----END PGP SIGNATURE-----

feat(): make gh auth login conditional for separate source repo token 🚀

style(lint): fix lint issues 🐛

feat(): add PAT 🚀

feat(): add PAT 🚀

feat(): add PAT 🚀

feat(): add PAT 🚀

feat(): add PAT 🚀

feat(): add PAT 🚀

feat(): add PAT 🚀

doc(): update docs 📝

feat(): add option for PAT 🚀

feat(): add option for PAT 🚀

# This is the commit message AndreasAugustin#2:

feat(): add option for PAT 🚀

# This is the commit message AndreasAugustin#3:

feat(): add option for PAT 🚀

# This is the commit message AndreasAugustin#4:

feat(): add option for PAT 🚀

# This is the commit message AndreasAugustin#5:

feat(): add option for PAT 🚀

# This is the commit message AndreasAugustin#6:

trial(): add permissions 🐛
author Andy Augustin <[email protected]> 1672219390 +0100
committer Andy Augustin <[email protected]> 1672592292 +0100
gpgsig -----BEGIN PGP SIGNATURE-----

 iQGzBAABCAAdFiEEApgnwt2TStNZl6Y9UpE0XzZ/UkgFAmOxu6QACgkQUpE0XzZ/
 UkjAzgv/cWh9hE7VLkLM1nVmra945WUkOfWXHnCUnrsOWsxxSOkH1r2mLxZdnWtg
 BlFc4RciJAB39Nv1WBUt+hGBGOdYWcV1lxgSIpn+vNXd9/5xciEThRk9T1piHj+x
 xnZU2rW0dLlnEnFlIX1qkKeD+rjclXw46umjMgqwIF0vQSx5cR9y8sDCiqRGg2Fv
 G/k/xLoQwah0Ve8nwqd6dLwNYXl8cFBfvuZaGV/dt1+5BDl4J5mPYg4trxKx5xnB
 fTxTQ0G/qOa1OInW04EReJWZwQaGvyx5PqEFk0ESk8MuzFytfVVRCnHwdP/QvLO7
 S7Y79wUBAQfHvSlwOgBtlQc5eFOiKoxahUhJIcCMLw1r2+nRjuPAA0j07v6nmjDM
 sfxyVSpnYnKGAfGrYGboOHuEjqKegKdY3oIQFL/Ivln7kmLxGrFcpQ+QMTEJUsLw
 2AB+Yf+tJyQXnx8AiGQRnVlXW3FRCOQhCxK2zXMUpzwAsKcKYNnaKoM6jDN7EzRQ
 fZrB76EK
 =yGb3
 -----END PGP SIGNATURE-----

feat(): make gh auth login conditional for separate source repo token 🚀

style(lint): fix lint issues 🐛

feat(): add PAT 🚀

feat(): add PAT 🚀

feat(): add PAT 🚀

feat(): add PAT 🚀

feat(): add PAT 🚀

feat(): add PAT 🚀

feat(): add PAT 🚀

doc(): update docs 📝

feat(): add option for PAT 🚀

feat(): add option for PAT 🚀

feat(): add option for PAT 🚀

feat(): add option for PAT 🚀

feat(): add option for PAT 🚀

feat(): add option for PAT 🚀

trial(): add permissions 🐛

trial(): new trial for accessing private repo with PAT 🆙

trial(): new trial for accessing private repo with PAT 🆙

trial(): new trial for accessing private repo with PAT 🆙

trial(): new trial for accessing private repo with PAT 🆙

trial(): new trial for accessing private repo with PAT 🆙

trial(): new trial for accessing private repo with PAT 🆙

trial(): new trial for accessing private repo with PAT 🆙

trial(): new trial for accessing private repo with PAT 🆙
@msiebeneicher msiebeneicher force-pushed the feat/use_gh_auth_for_authentication branch 2 times, most recently from d34fa01 to d05baaf Compare January 2, 2023 10:11
@msiebeneicher msiebeneicher force-pushed the feat/use_gh_auth_for_authentication branch from d05baaf to a06016d Compare January 2, 2023 10:16
AndreasAugustin and others added 7 commits January 2, 2023 17:18
Signed-off-by: andy Augustin <[email protected]>
Signed-off-by: andy Augustin <[email protected]>
Signed-off-by: andy Augustin <[email protected]>
* chore: add test for PAT 🚀
* chore(gh-cli): update gh cli version to latest 🚀
* style(lint): fix lint issues 🐛
* doc(): update docs 📝

Signed-off-by: andy Augustin <[email protected]>
Co-authored-by: Marc Siebeneicher <[email protected]>
Copy link
Contributor Author

@msiebeneicher msiebeneicher left a comment

Choose a reason for hiding this comment

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

for me the PR looks fine now

@AndreasAugustin AndreasAugustin merged commit 7a33121 into AndreasAugustin:main Jan 3, 2023
@msiebeneicher msiebeneicher deleted the feat/use_gh_auth_for_authentication branch January 3, 2023 12:03
joschi36 added a commit to swisstxt/actions-template-sync that referenced this pull request Oct 18, 2023
reverts AndreasAugustin#239
because we need multiple tokens and are already
logged in to github with another token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

Use gh auth for general authentication

2 participants