Rename project to actions-sync
This commit is contained in:
1
test/fixtures/repo.git/COMMIT_EDITMSG
vendored
Normal file
1
test/fixtures/repo.git/COMMIT_EDITMSG
vendored
Normal file
@@ -0,0 +1 @@
|
||||
change 2
|
||||
1
test/fixtures/repo.git/HEAD
vendored
Normal file
1
test/fixtures/repo.git/HEAD
vendored
Normal file
@@ -0,0 +1 @@
|
||||
ref: refs/heads/master
|
||||
12
test/fixtures/repo.git/config
vendored
Normal file
12
test/fixtures/repo.git/config
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = false
|
||||
logallrefupdates = true
|
||||
ignorecase = true
|
||||
precomposeunicode = true
|
||||
[receive]
|
||||
denyCurrentBranch = false
|
||||
[remote "origin"]
|
||||
url = git://localhost:9419/org/repo
|
||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||
1
test/fixtures/repo.git/description
vendored
Normal file
1
test/fixtures/repo.git/description
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Unnamed repository; edit this file 'description' to name the repository.
|
||||
BIN
test/fixtures/repo.git/index
vendored
Normal file
BIN
test/fixtures/repo.git/index
vendored
Normal file
Binary file not shown.
6
test/fixtures/repo.git/info/exclude
vendored
Normal file
6
test/fixtures/repo.git/info/exclude
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# git ls-files --others --exclude-from=.git/info/exclude
|
||||
# Lines that start with '#' are comments.
|
||||
# For a project mostly in C, the following would be a good set of
|
||||
# exclude patterns (uncomment them if you want to use them):
|
||||
# *.[oa]
|
||||
# *~
|
||||
2
test/fixtures/repo.git/logs/HEAD
vendored
Normal file
2
test/fixtures/repo.git/logs/HEAD
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
0000000000000000000000000000000000000000 a5984bb887dd2fcdc2892cd906d6f004844d1142 Hayden Faulds <fauldsh@gmail.com> 1588240827 +0100 commit (initial): change 1
|
||||
a5984bb887dd2fcdc2892cd906d6f004844d1142 e9009d51dd6da2c363d1d14779c53dd27fcb0c52 Hayden Faulds <fauldsh@gmail.com> 1588240840 +0100 commit: change 2
|
||||
2
test/fixtures/repo.git/logs/refs/heads/master
vendored
Normal file
2
test/fixtures/repo.git/logs/refs/heads/master
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
0000000000000000000000000000000000000000 a5984bb887dd2fcdc2892cd906d6f004844d1142 Hayden Faulds <fauldsh@gmail.com> 1588240827 +0100 commit (initial): change 1
|
||||
a5984bb887dd2fcdc2892cd906d6f004844d1142 e9009d51dd6da2c363d1d14779c53dd27fcb0c52 Hayden Faulds <fauldsh@gmail.com> 1588240840 +0100 commit: change 2
|
||||
BIN
test/fixtures/repo.git/objects/10/a7b9ed97523452d831130412b838066ac329ac
vendored
Normal file
BIN
test/fixtures/repo.git/objects/10/a7b9ed97523452d831130412b838066ac329ac
vendored
Normal file
Binary file not shown.
BIN
test/fixtures/repo.git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904
vendored
Normal file
BIN
test/fixtures/repo.git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904
vendored
Normal file
Binary file not shown.
BIN
test/fixtures/repo.git/objects/6b/724d277c31836130aee73c0ceeeb8bb3f54c3d
vendored
Normal file
BIN
test/fixtures/repo.git/objects/6b/724d277c31836130aee73c0ceeeb8bb3f54c3d
vendored
Normal file
Binary file not shown.
BIN
test/fixtures/repo.git/objects/a5/984bb887dd2fcdc2892cd906d6f004844d1142
vendored
Normal file
BIN
test/fixtures/repo.git/objects/a5/984bb887dd2fcdc2892cd906d6f004844d1142
vendored
Normal file
Binary file not shown.
BIN
test/fixtures/repo.git/objects/a8/818801f7b84e5b6f9d86149743cb26dc8f7b7f
vendored
Normal file
BIN
test/fixtures/repo.git/objects/a8/818801f7b84e5b6f9d86149743cb26dc8f7b7f
vendored
Normal file
Binary file not shown.
BIN
test/fixtures/repo.git/objects/bf/58b170d97d40fa12631a9653944cd1086f8cc4
vendored
Normal file
BIN
test/fixtures/repo.git/objects/bf/58b170d97d40fa12631a9653944cd1086f8cc4
vendored
Normal file
Binary file not shown.
2
test/fixtures/repo.git/objects/e9/009d51dd6da2c363d1d14779c53dd27fcb0c52
vendored
Normal file
2
test/fixtures/repo.git/objects/e9/009d51dd6da2c363d1d14779c53dd27fcb0c52
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
x<01><>M
|
||||
<EFBFBD>0F]<5D><14>d2<64><32>q%^#<23>$m<>?RӅ<52><D385>xW<1F>ǃ/<2F><><V jNu<4E><19><>A[<5B>(<28><><EFBFBD><EFBFBD>Wq<57>}<7D>M<EFBFBD><4D>4ɡ<34>b^a<>K<EFBFBD><4B>z<EFBFBD>E:U*I<13><><EFBFBD><1E><><EFBFBD><EFBFBD>¬<EFBFBD>2<EFBFBD><32><EFBFBD>a<EFBFBD><61>><3E>x<>}<7D>7\<5C>o<EFBFBD>{?<3F>q<EFBFBD><71>u<EFBFBD><75>mE<6D>Q<18><><16><1C><>X<EFBFBD>_<EFBFBD>ICX<43>d<><64>$E<>
|
||||
1
test/fixtures/repo.git/refs/heads/master
vendored
Normal file
1
test/fixtures/repo.git/refs/heads/master
vendored
Normal file
@@ -0,0 +1 @@
|
||||
e9009d51dd6da2c363d1d14779c53dd27fcb0c52
|
||||
0
test/fixtures/repo.git/refs/tags/.gitkeep
vendored
Normal file
0
test/fixtures/repo.git/refs/tags/.gitkeep
vendored
Normal file
49
test/github.go
Normal file
49
test/github.go
Normal file
@@ -0,0 +1,49 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"path"
|
||||
|
||||
"github.com/google/go-github/v25/github"
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var port, gitDaemonURL string
|
||||
flag.StringVar(&port, "p", "", "")
|
||||
flag.StringVar(&gitDaemonURL, "git-daemon-url", "", "")
|
||||
flag.Parse()
|
||||
|
||||
r := mux.NewRouter()
|
||||
r.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) {})
|
||||
r.HandleFunc("/api/v3/orgs/{org}/repos", func(w http.ResponseWriter, r *http.Request) {
|
||||
orgName := mux.Vars(r)["org"]
|
||||
b, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
var repoReq struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
err = json.Unmarshal(b, &repoReq)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
cloneURL := gitDaemonURL + path.Join(orgName, repoReq.Name, ".git")
|
||||
repo := github.Repository{Name: &repoReq.Name, CloneURL: &cloneURL}
|
||||
b, _ = json.Marshal(repo)
|
||||
_, err = w.Write(b)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}).Methods("POST")
|
||||
|
||||
err := http.ListenAndServe(":"+port, r)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user