Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: Parameterize GitHub token environment variable #12

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# See README for instructions on generating Github token
GITHUB_READ_API_TOKEN=1234
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
.rspec_status
*.iml
Gemfile.lock

.env.local
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source "https://rubygems.org"
# Specify your gem's dependencies in library_version_analysis.gemspec
gemspec

gem 'dotenv-rails', "~> 2.8.1", groups: [:development, :test]
gem "rake", "~> 12.0"
gem "rspec", "~> 3.0"

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

To run the shell script locally, you must first set up the environment variables in the `.env.local` file.
To generate the Github token, follow these steps:
1. From any page on Github, click your icon at the top right, and click Settings
2. Click Developer Settings in the left panel
3. Click Personal Access Tokens and then `Tokens Classic`
4. Click Generate New Token -> Generate new token (classic)
5. Create a token with the `Repo` scope enabled
6. Add the token to the `.env.local` file under the `GITHUB_READ_API_TOKEN` entry

## Jobber Dev
Update the gemfile to read:
jgem :enablers, "library_version_analysis", path: "/Users/johnz/source/library_version_analysis"
Expand Down
1 change: 1 addition & 0 deletions lib/library_version_analysis/github.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require "graphql/client"
require "graphql/client/http"
require 'dotenv/load'

module LibraryVersionAnalysis
class Github
Expand Down