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

Make token semantics match actions/checkout #65

Merged
merged 2 commits into from
Apr 25, 2023
Merged

Make token semantics match actions/checkout #65

merged 2 commits into from
Apr 25, 2023

Conversation

jcbhmr
Copy link
Contributor

@jcbhmr jcbhmr commented Apr 19, 2023

this pr would...

  • make it say token: ${{ secrets.TOKENHERE }} in readme
  • use https://x:$TOKEN@github.com/user/repo.wiki.git in git ops
  • set default to token: ${{ github.token }} in action.yml
  • not change anything else

@jcbhmr
Copy link
Contributor Author

jcbhmr commented Apr 19, 2023

@spenserblack request review

Copy link
Owner

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

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

I just remembered that gh is installed in actions, and we can use that.
Just set the environment variable GH_TOKEN when using gh, and clone with gh repo clone ${{ inputs.repository }}.wiki. It should simplify authentication concerns, and is worth checking out.

@jcbhmr jcbhmr requested a review from spenserblack April 24, 2023 18:21
@jcbhmr
Copy link
Contributor Author

jcbhmr commented Apr 24, 2023

I just remembered that gh is installed in actions, and we can use that. Just set the environment variable GH_TOKEN when using gh, and clone with gh repo clone ${{ inputs.repository }}.wiki. It should simplify authentication concerns, and is worth checking out.

ill have to try that! idk if itll work since it's not cloning a project, but cloning the .wiki.git git repo.

basically, the question is: does this work?

gh repo clone spenserblack/actions-wiki.wiki
gh repo clone spenserblack/actions-wiki.wiki.git

???

i havent tried so it might work, or might not 🤷‍♂️

@jcbhmr
Copy link
Contributor Author

jcbhmr commented Apr 24, 2023

also question is if gh repo clone supports different non-github.heygears.com enterprie-hosted github instances. basically, does it support $GITHUB_SERVER_URL

@jcbhmr
Copy link
Contributor Author

jcbhmr commented Apr 24, 2023

@spenserblack 🥳 it works!
image

@jcbhmr
Copy link
Contributor Author

jcbhmr commented Apr 24, 2023

i think merge this with the $GITHUB_ACTOR thing, and then in the future consider the gh cli instead? sound good @spenserblack ?

@spenserblack
Copy link
Owner

also question is if gh repo clone supports different non-github.heygears.com enterprie-hosted github instances. basically, does it support $GITHUB_SERVER_URL

Yeah, gh should be able to support other hosts. The format of the repo URL for most gh commands is [HOST/]OWNER/REPO.

@spenserblack spenserblack merged commit f1a21c6 into spenserblack:main Apr 25, 2023
@jcbhmr jcbhmr deleted the better-token branch April 25, 2023 17:48
# 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.

2 participants