Skip to content

Commit

Permalink
fixes and change to polkadot-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
girazoki committed Nov 2, 2023
1 parent 2a56173 commit 48d031a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tools/github/generate-release-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function main() {
const previousTag = argv.from;
const newTag = argv.to;

const moduleLinks = ["substrate", "frontier", "cumulus", "frontier"].map((repoName) => ({
const moduleLinks = ["polkadot-sdk", "frontier"].map((repoName) => ({
name: repoName,
link: getCompareLink(repoName, previousTag, newTag),
}));
Expand Down
13 changes: 2 additions & 11 deletions tools/github/github-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,16 @@ type Await<T> = T extends PromiseLike<infer U> ? U : T;
type Commits = Await<ReturnType<Octokit["rest"]["repos"]["compareCommits"]>>["data"]["commits"];

export function getCompareLink(packageName: string, previousTag: string, newTag: string) {
console.log(packageName);

const previousPackage = execSync(
`git show ${previousTag}:../Cargo.lock | grep ${packageName}? | head -1 | grep -o '".*"'`
).toString();
const previousCommit = /#([0-9a-f]*)/g.exec(previousPackage)[1].slice(0, 8);
const previousRepo = /(https:\/\/.*)\?/g.exec(previousPackage)[1];

// Temporary solution
// TODO: we should pass here only polkadot-sdk after this release
let newPackage;
try { newPackage = execSync(
const newPackage = execSync(
`git show ${newTag}:../Cargo.lock | grep ${packageName}? | head -1 | grep -o '".*"'`
).toString()}
catch {
newPackage = execSync(
`git show ${newTag}:../Cargo.lock | grep polkadot-sdk? | head -1 | grep -o '".*"'`
).toString()
};
).toString();
const newCommit = /#([0-9a-f]*)/g.exec(newPackage)[1].slice(0, 8);
const newRepo = /(https:\/\/.*)\?/g.exec(newPackage)[1];
const newRepoOrganization = /github.com\/([^\/]*)/g.exec(newRepo)[1];
Expand Down

0 comments on commit 48d031a

Please sign in to comment.