Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the need for valid SSH keys linked to your github when using opam-publish #154

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
all: opam-publish
all: build

ALWAYS:
@

opam-publish: ALWAYS
dune build _build/default/src/publishMain.exe
@cp _build/default/src/publishMain.exe $@

build: ALWAYS
dune build @install --dev
dune build @install
cp _build/default/src/publishMain.exe ./opam-publish

install: ALWAYS
dune install
Expand Down
6 changes: 3 additions & 3 deletions src/publishSubmit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let () =

let (/) a b = String.concat "/" [a;b]

let github_root = "git@github.com:"
let github_root ~token = Github.Token.to_string token^"@github.com:"

type github_repo = string * string (* owner, name *)

Expand Down Expand Up @@ -227,10 +227,10 @@ let init_mirror root repo user token =
"Cloning the package repository, this may take a while...\n";
git_command ~verbose:true
["clone";
github_root^(fst repo)/(snd repo)^".git";
github_root ~token^(fst repo)/(snd repo)^".git";
OpamFilename.Dir.to_string dir];
GH.fork token repo;
git_command ~dir ["remote"; "add"; "user"; github_root^user/(snd repo)]
git_command ~dir ["remote"; "add"; "user"; github_root ~token^user/(snd repo)]

let update_mirror root repo ~user ~token branch =
let dir = repo_dir root repo in
Expand Down