Skip to content

Instantly share code, notes, and snippets.

@Goldziher
Created October 10, 2022 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Goldziher/59303db409f5c1889f07cb38ca23065e to your computer and use it in GitHub Desktop.
Save Goldziher/59303db409f5c1889f07cb38ca23065e to your computer and use it in GitHub Desktop.
makefile that injects git user from github config
GH_CONFIG := ~/.config/gh/hosts.yml
GITHUB_USER := $(shell cat $(GH_CONFIG) | yq '.[].user' | xargs)
GITHUB_TOKEN := $(shell cat $(GH_CONFIG) | yq '.[].oauth_token' | xargs)
.PHONY: all
build:
docker build --build-arg=GITHUB_USER=$(GITHUB_USER) --build-arg=GITHUB_TOKEN=$(GITHUB_TOKEN) .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment