mirror of
https://github.com/danbee/micropub.git
synced 2025-03-04 08:59:13 +00:00
Use env.fetch and default to master branch
This commit is contained in:
parent
a8ab4a25f9
commit
3365485720
@ -24,7 +24,7 @@ module Micropub
|
||||
path: path,
|
||||
message: "Posting a post",
|
||||
content: post.post_content,
|
||||
branch: "api_test",
|
||||
branch: ENV.fetch("GITHUB_BRANCH", "master"),
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ module Micropub
|
||||
|
||||
github = Github.new
|
||||
|
||||
endpoints = Indieauth::Endpoints.new(ENV["SITE_URL"])
|
||||
endpoints = Indieauth::Endpoints.new(ENV.fetch("SITE_URL"))
|
||||
token = Indieauth::Token.new(endpoints.token_endpoint)
|
||||
|
||||
get '/' do
|
||||
@ -24,7 +24,7 @@ module Micropub
|
||||
end
|
||||
|
||||
post "/micropub/main" do
|
||||
if token.validate(ENV["INDIEAUTH_TOKEN"])
|
||||
if token.validate(ENV.fetch("INDIEAUTH_TOKEN"))
|
||||
post = Post.new(params)
|
||||
|
||||
if github.post!(post)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user