Skip to content

Commit abca6f1

Browse files
authored
build: Derive GH owner/repo via gh (#833)
Using directory path previously was fragile dependent on where the repo was cloned to locally.
1 parent be656f7 commit abca6f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

make/repo.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ GIT_COMMIT := $(shell git rev-parse "HEAD^{commit}")
99
export GIT_TAG ?= $(shell git describe --tags "$(GIT_COMMIT)^{commit}" --match v* --abbrev=0 2>/dev/null)
1010
export GIT_CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
1111

12-
export GITHUB_ORG := $(notdir $(realpath $(dir $(REPO_ROOT))))
13-
export GITHUB_REPOSITORY := $(notdir $(REPO_ROOT))
12+
export GITHUB_ORG := $(shell gh repo view --jq '.owner.login' --json owner)
13+
export GITHUB_REPOSITORY := $(shell gh repo view --jq '.name' --json name)
1414

1515
ifneq ($(shell git status --porcelain 2>/dev/null; echo $$?), 0)
1616
export GIT_TREE_STATE := dirty

0 commit comments

Comments
 (0)