#Summary
Just released a new step: authenticate-with-github-oauth, so if you have two-factor authentication, private submodules, etc. then using a Personal Access Token would be the best bet.
To make this possible globally, this step writes GitHub OAuth configs to the ~/.netrc
file, so every single network call pointing to github.com
or api.github.com
hosts will be accessed with the given Personal Access Token and the GitHub username.
#Add the step to your workflow
This step should be before any other git step in your workflow. Can go straight to the first place.
An example bitrise.yml:
---
format_version: 1.3.1
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
workflows:
primary:
steps:
- authenticate-with-github-oauth:
inputs:
- username: myusername
- access_token: myaccesstoken
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone: {}
before_run:
after_run:
#Configuring the step
- GitHub username: your GitHub username
- Personal Access Token: your Personal Access Token
#Get a GitHub Personal Access Token
- Login to yout GitHub account
- In the upper-right corner of any page, click your profile photo, then click Settings.
- In the left sidebar, click Personal access tokens.
- Click Generate new token.
- Give your token a descriptive name.
- Select the scopes, or permissions, you’d like to grant this token.
- Click Generate token.
Happy Coding!