diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb
index 2e183989904756a9b706b0b8551ad6ed0ee428c0..75ddba1483946b91ae6773f5da6323ef98c12ace 100644
--- a/Library/Homebrew/formula_creator.rb
+++ b/Library/Homebrew/formula_creator.rb
@@ -75,6 +75,7 @@ module Homebrew
             metadata = GitHub.repository(@user, @name)
             @desc = metadata["description"]
             @homepage = metadata["homepage"]
+            @license = metadata["license"]["spdx_id"] if metadata["license"]
           rescue GitHub::HTTPNotFoundError
             # If there was no repository found assume the network connection is at
             # fault rather than the input URL.