1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Simplified GITHUB_TOKEN argument [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2019-08-15 21:26:32 +09:00
parent 53a55aeff3
commit fff2b231a3
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -190,10 +190,7 @@ checkout-github: fetch-github
.PHONY: update-github
update-github: checkout-github
$(eval PULL_REQUEST_API := https://api.github.com/repos/ruby/ruby/pulls/$(PR))
$(if $(GITHUB_TOKEN), \
$(eval PULL_REQUEST := $(shell curl -s -H "Authorization: bearer $$GITHUB_TOKEN" $(PULL_REQUEST_API))), \
$(eval PULL_REQUEST := $(shell curl -s $(PULL_REQUEST_API))) \
)
$(eval PULL_REQUEST := $(shell curl -s $(if $(GITHUB_TOKEN),-H "Authorization: bearer $(GITHUB_TOKEN)") $(PULL_REQUEST_API)))
$(eval FORK_REPO := $(shell $(BASERUBY) -rjson -e 'print JSON.parse(ARGV[0]).dig("head", "repo", "full_name")' '$(PULL_REQUEST)'))
$(eval PR_BRANCH := $(shell $(BASERUBY) -rjson -e 'print JSON.parse(ARGV[0]).dig("head", "ref")' '$(PULL_REQUEST)'))
git merge master --no-edit