forked from supertokens/supertokens-docker-postgresql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdateReadme.js
36 lines (30 loc) · 836 Bytes
/
updateReadme.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const https = require("https")
const fs = require("fs")
const README = fs.readFileSync("./README.md", {encoding: "utf-8"});
const data = JSON.stringify({
full_description: README,
description: "Docker image for SuperTokens with PostgreSQL"
});
const token = process.env.TOKEN;
const options = {
hostname: "hub.docker.com",
port: 443,
path: "/v2/repositories/supertokens/supertokens-postgresql/",
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Content-Length": data.length,
"Authorization": `JWT ${token}`
}
}
const req = https.request(options, res => {
console.log(`statusCode: ${res.statusCode}`);
res.on('data', d => {
process.stdout.write(d);
});
})
req.on('error', error => {
console.error(error)
});
req.write(data);
req.end();