Skip to content

git-fork | update to match REST-API auth standards as of 2021-06#928

Merged
spacewander merged 6 commits intotj:masterfrom
duckunix:master
Jun 9, 2021
Merged

git-fork | update to match REST-API auth standards as of 2021-06#928
spacewander merged 6 commits intotj:masterfrom
duckunix:master

Conversation

@duckunix
Copy link
Copy Markdown
Contributor

@duckunix duckunix commented Jun 4, 2021

  • Removed prompt for OATH Token
  • Change prompt from 'password' to 'GitHub Personal Access Token'

- Removed prompt for OATH Token
- Change prompt from 'password' to 'GitHub Personal Access Token'
Comment thread bin/git-fork Outdated
read user
[ -n "$user" ] || abort "git username required"
echo "Enter github password for user \"$user\""
echo "Enter github Personal Access Token for user \"$user\""
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can fetch token like this:

github_personal_access_token=$(git config git-extras.github-personal-access-token)

Don't forget to update the doc

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Oh, interesting 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay, I have updated the code based on @spacewander 's feedback. Thanks!

duckunix added 2 commits June 4, 2021 20:08
Added support for pulling personal-access-token, borrowing from git-pull-request
Comment thread bin/git-fork
# personal access token
# config name is github-personal-access-token '_' is not allowed in git config

github_personal_access_token=$(git config git-extras.github-personal-access-token)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay...updated.

@duckunix
Copy link
Copy Markdown
Contributor Author

duckunix commented Jun 5, 2021

This address #927

Comment thread man/git-fork.md Outdated

Remotes will use ssh if you have it configured with GitHub, if not, https will be used.

Create pull request for a project on GitHub via command line.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should update the "pull request" to "fork"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack...good catch. Fixed.

Comment thread man/git-fork.md Outdated
Create a fork of a project on GitHub via command line.

A personal access token is required for making the API call to open the pull request(s) in GitHub. [API Documentation here](https://docs.github.com/en/rest/reference/pulls#create-a-pull-request)
A personal access token is required for making the API call to create a fork in GitHub. [API Documentation here](https://docs.github.com/en/rest/reference/pulls#create-a-pull-request)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The link should be updated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry, missed that. Thanks for keeping a good eye on the PRs. Fixed this via 30383f9

@spacewander spacewander merged commit b225ed4 into tj:master Jun 9, 2021
spacewander pushed a commit to spacewander/git-extras that referenced this pull request Jul 9, 2021
Added support for pulling personal-access-token, borrowing from git-pull-request
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

Successfully merging this pull request may close these issues.

3 participants