Skip to content

Commit

Permalink
github: update @octokit/openapi-types to fix release script (#1722)
Browse files Browse the repository at this point in the history
* github: update @octokit/openapi-types to fix release script

* lerna: remove --no-verify-access
  • Loading branch information
williaster authored Jun 28, 2023
1 parent 1780e70 commit 98efa73
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@octokit/openapi-types": "18.0.0",
"@octokit/rest": "18.1.0",
"@testing-library/jest-dom": "^5.9.0",
"@testing-library/react": "^13.1.0",
Expand Down
18 changes: 10 additions & 8 deletions scripts/performRelease/performLernaRelease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { PR } from './types';
const exec = util.promisify(childProcess.exec);

export function isReleasePR(pr: PR) {
return RELEASE_LABELS.some(releaseLabel => pr.labels.some(label => label.name === releaseLabel));
return RELEASE_LABELS.some((releaseLabel) =>
pr.labels.some((label) => label.name === releaseLabel),
);
}

export default async function performLernaRelease(prsSinceLastTag: PR[]) {
Expand All @@ -18,17 +20,17 @@ export default async function performLernaRelease(prsSinceLastTag: PR[]) {
}

// run lerna based on the type of release
const isPreRelease = releasePRsSinceLastTag.some(pr =>
const isPreRelease = releasePRsSinceLastTag.some((pr) =>
// note that this logic requires that all alpha tags be removed from PRs
// in order to trigger a non-alpha release. git keeps tag history so
// preserving context should not be an issue
pr.labels.some(label => label.name === ALPHA_RELEASE),
pr.labels.some((label) => label.name === ALPHA_RELEASE),
);
const isMinor = releasePRsSinceLastTag.some(pr =>
pr.labels.some(label => label.name === MINOR_RELEASE),
const isMinor = releasePRsSinceLastTag.some((pr) =>
pr.labels.some((label) => label.name === MINOR_RELEASE),
);
const isMajor = releasePRsSinceLastTag.some(pr =>
pr.labels.some(label => label.name === MAJOR_RELEASE),
const isMajor = releasePRsSinceLastTag.some((pr) =>
pr.labels.some((label) => label.name === MAJOR_RELEASE),
);

// perform release
Expand All @@ -43,7 +45,7 @@ export default async function performLernaRelease(prsSinceLastTag: PR[]) {

const { stdout, stderr } = await exec(
// --no-verify-access is needed because the CI token isn't valid for that endpoint
`npx lerna publish ${version} --exact --yes --no-verify-access --dist-tag ${distTag}`,
`npx lerna publish ${version} --exact --yes --dist-tag ${distTag}`,
);
if (stdout) {
console.log('Lerna output', stdout);
Expand Down
2 changes: 1 addition & 1 deletion scripts/performRelease/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { components } from '@octokit/openapi-types/generated/types';
import type { components } from '@octokit/openapi-types';

export type PR = components['schemas']['pull-request-simple'];
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2297,7 +2297,7 @@
"@octokit/types" "^9.0.0"
universal-user-agent "^6.0.0"

"@octokit/openapi-types@^18.0.0":
"@octokit/openapi-types@18.0.0", "@octokit/openapi-types@^18.0.0":
version "18.0.0"
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-18.0.0.tgz#f43d765b3c7533fd6fb88f3f25df079c24fccf69"
integrity sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==
Expand Down

0 comments on commit 98efa73

Please sign in to comment.