Add manifest
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 57s

This commit is contained in:
Alexandre Bruyant 2024-01-06 13:54:39 +01:00
parent 971e77229a
commit 53002d1e97
2 changed files with 20 additions and 6 deletions

19
action.yaml Normal file
View File

@ -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"

View File

@ -38,11 +38,6 @@ func main() {
githubactions.Fatalf("Missing: ipfs_port") githubactions.Fatalf("Missing: ipfs_port")
} }
token := githubactions.GetInput("ipfs_token")
if token == "" {
githubactions.Fatalf("Missing: ipfs_token")
}
targetPath, err := os.Open(path) targetPath, err := os.Open(path)
if err != nil { if err != nil {
githubactions.Fatalf("Unable to access path_to_add: %v", err.Error()) githubactions.Fatalf("Unable to access path_to_add: %v", err.Error())
@ -117,5 +112,5 @@ func main() {
var ipfsAddResponse AddResponse var ipfsAddResponse AddResponse
json.Unmarshal(resBody, &ipfsAddResponse) json.Unmarshal(resBody, &ipfsAddResponse)
fmt.Println(ipfsAddResponse.Hash) githubactions.SetOutput("cid", ipfsAddResponse.Hash)
} }