This is a guide on how to set up a fastlane lane to create pull requests:
- Set Up Fastlane:
- Add a Gemfile file in the root of the repo
- Add these to the Gemfile:
source "https://rubygems.org" gem "fastlane"- Run
bundle update - Run
bundle exec fastlane init
- Set Up the PR lane:
- Run
cd fastlane - Edit the
Fastfilefile to add the PR lane:
- Run
- Add your Github PAT to an environment file:
- Create a new file called
.envinside the fastlane folder. - Paste this inside:
GITHUB_API_TOKEN="YOUR_GITHUB_PAT" - Add the
.envfile to the.gitignore:fastlane/.env
- Create a new file called
- Run the lane:
bundle exec fastlane pr
- Additionally, you could add an alias to the
.zshrcfile for easier usage:- Run
vim ~/.zshrc - Add a new alias:
alias pr='cd ~/your-project && bundle exec fastlane pr'
- Run
- Also additionally, you could add some documentation to your Contributing guidelines:
Now you can run pr from anywhere in your console and send a PR from your console 😄.
You can find a repository where everything is set up here.
Remember that the lane won’t work in your pc for that repository, given you don’t have a valid PAT in the .env file.