-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateReleaseNotes.js
More file actions
28 lines (25 loc) · 913 Bytes
/
Copy pathupdateReleaseNotes.js
File metadata and controls
28 lines (25 loc) · 913 Bytes
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
const { Octokit } = require("@octokit/rest");
// TODO: change these values
const owner = 'REPO_OWNER' // ex. 'ConsenSys'
const repo = 'REPO_NAME' // ex. 'quorum'
const auth = 'ACCESS_TOKEN' // ex. 'ea5330f68542cdabfb92a4517b1b702ef70504f6'
// TODO: update the URLs based on the requirements
const oldUrl = 'bintray.com/quorumengineering/quorum/download_file?file_path=';
const newUrl = 'artifacts.consensys.net/public/go-quorum/raw/versions/';
(async () => {
const octokit = new Octokit({ auth });
const { data: releases } = await octokit.repos.listReleases({
owner,
repo,
});
for (const release of releases) {
console.log('Release id to be updated :>> ', release.id);
await octokit.repos.updateRelease({
owner,
repo,
release_id: release.id,
body: release.body.split(oldUrl).join(newUrl)
});
console.log('Release id updated :>> ', release.id);
}
})()