Skip to content

Commit

Permalink
build: Derive GH owner/repo via gh (#833)
Browse files Browse the repository at this point in the history
Using directory path previously was fragile dependent on where the repo
was
cloned to locally.
  • Loading branch information
jimmidyson authored Jul 30, 2024
1 parent be656f7 commit abca6f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions make/repo.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ GIT_COMMIT := $(shell git rev-parse "HEAD^{commit}")
export GIT_TAG ?= $(shell git describe --tags "$(GIT_COMMIT)^{commit}" --match v* --abbrev=0 2>/dev/null)
export GIT_CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)

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

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

0 comments on commit abca6f1

Please sign in to comment.