diff --git a/action.yaml b/action.yaml new file mode 100644 index 0000000..62060a8 --- /dev/null +++ b/action.yaml @@ -0,0 +1,19 @@ +# action.yml +name: "IPFS Node Pin" +description: "Pin a directory to an IPFS node using its HTTP API" +inputs: + ipfs_host: + description: "IPFS node host" + required: true + ipfs_port: + description: "IPFS node port" + required: true + path_to_add: + description: "Directory path to pin" + required: true +outputs: + cid: + description: "CID of pinned directory" +runs: + using: "docker" + image: "Dockerfile" diff --git a/main.go b/main.go index 685555a..aece312 100644 --- a/main.go +++ b/main.go @@ -38,11 +38,6 @@ func main() { githubactions.Fatalf("Missing: ipfs_port") } - token := githubactions.GetInput("ipfs_token") - if token == "" { - githubactions.Fatalf("Missing: ipfs_token") - } - targetPath, err := os.Open(path) if err != nil { githubactions.Fatalf("Unable to access path_to_add: %v", err.Error()) @@ -117,5 +112,5 @@ func main() { var ipfsAddResponse AddResponse json.Unmarshal(resBody, &ipfsAddResponse) - fmt.Println(ipfsAddResponse.Hash) + githubactions.SetOutput("cid", ipfsAddResponse.Hash) }