From 5adefab053709a90aef51ccf40069eaf1352be8b Mon Sep 17 00:00:00 2001 From: Zou Nengren Date: Tue, 24 Mar 2020 14:22:43 +0800 Subject: [PATCH] send token in the header instead of api call (#3764) Automatically submitted. --- Makefile.release | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile.release b/Makefile.release index 852a02f59..76517e0a0 100644 --- a/Makefile.release +++ b/Makefile.release @@ -112,14 +112,15 @@ tar: .PHONY: github-push github-push: @echo Releasing: $(VERSION) - @$(eval RELEASE:=$(shell curl -s -d '{"tag_name": "v$(VERSION)", "name": "v$(VERSION)"}' "https://api.github.com/repos/$(GITHUB)/$(NAME)/releases?access_token=${GITHUB_ACCESS_TOKEN}" | grep -m 1 '"id"' | tr -cd '[[:digit:]]')) + @$(eval RELEASE:=$(shell curl -s -d '{"tag_name": "v$(VERSION)", "name": "v$(VERSION)"}' -H "Authorization: token ${GITHUB_ACCESS_TOKEN}" "https://api.github.com/repos/$(GITHUB)/$(NAME)/releases" | grep -m 1 '"id"' | tr -cd '[[:digit:]]')) @echo ReleaseID: $(RELEASE) @( cd release; for asset in `ls -A *tgz`; do \ echo $$asset; \ curl -o /dev/null -X POST \ -H "Content-Type: application/gzip" \ + -H "Authorization: token ${GITHUB_ACCESS_TOKEN}" --data-binary "@$$asset" \ - "https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}&access_token=${GITHUB_ACCESS_TOKEN}" ; \ + "https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}" ; \ done ) @( cd release; for asset in `ls -A *tgz`; do \ sha256sum $$asset > $$asset.sha256; \ @@ -128,8 +129,9 @@ github-push: echo $$asset; \ curl -o /dev/null -X POST \ -H "Content-Type: text/plain" \ + -H "Authorization: token ${GITHUB_ACCESS_TOKEN}" --data-binary "@$$asset" \ - "https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}&access_token=${GITHUB_ACCESS_TOKEN}" ; \ + "https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}" ; \ done ) .PHONY: docker-build