github / platform-samples

A public place for all platform sample projects.
Creative Commons Zero v1.0 Universal
1.87k stars 1.73k forks source link

Environment variables GITHUB_APP_ID & GITHUB_APP_PRIVATE_KEY #214

Open SergioFaya opened 5 years ago

SergioFaya commented 5 years ago

Issue

I am doing the building your first github app guide, and in documentation at section runtime environment the variables have different naming than in code.

Vars on Guide

export GITHUB_APP_IDENTIFIER=12345 export GITHUB_PRIVATE_KEY= ...

Vars on Code

begin
  GITHUB_APP_ID = ENV.fetch("GITHUB_APP_ID")
  GITHUB_PRIVATE_KEY = ENV.fetch("GITHUB_APP_PRIVATE_KEY")
rescue KeyError
  $stderr.puts "To run this script, please set the following environment variables:"
  $stderr.puts "- GITHUB_APP_ID: GitHub App ID"
  $stderr.puts "- GITHUB_APP_PRIVATE_KEY: GitHub App Private Key"
  exit 1
end

Solution

Decide if the docs have to be changed or the code, if the code has to be changed I will be pleased to make a pull request to fix this.

chopperette commented 5 years ago

begin GITHUB_APP_ID = ENV.fetch("GITHUB_APP_ID") GITHUB_PRIVATE_KEY = ENV.fetch("GITHUB_APP_PRIVATE_KEY") rescue KeyError $stderr.puts "To run this script, please set the following environment variables:" $stderr.puts "- GITHUB_APP_ID: GitHub App ID" $stderr.puts "- GITHUB_APP_PRIVATE_KEY: GitHub App Private Key" exit 1 end