Skip to content

Commit d367820

Browse files
authored
feat: Add "octokit": { "openapi-version": "1.0.1" } to package.json (#11)
1 parent 7ab6b5f commit d367820

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

.github/workflows/release-notification.yml

-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ jobs:
1212
with:
1313
app_id: ${{ secrets.RELEASE_NOTIFIER_APP_ID }}
1414
private_key: ${{ secrets.RELEASE_NOTIFIER_APP_PRIVATE_KEY }}
15-
dispatch_event_type: "octokit/openapi-types.ts release"

package.json

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
22
"name": "@octokit/openapi-types",
3-
"publishConfig": {
4-
"access": "public"
5-
},
3+
"publishConfig": { "access": "public" },
64
"version": "1.0.0",
75
"description": "Generated TypeScript definitions based on GitHub's OpenAPI spec",
86
"main": "generated/types.ts",
@@ -12,12 +10,10 @@
1210
"license": "MIT",
1311
"scripts": {
1412
"download": "node scripts/download",
15-
"generate-types": "npx openapi-typescript cache/openapi-schema.json -o generated/types.ts"
16-
},
17-
"devDependencies": {
18-
"openapi-typescript": "^2.4.2"
13+
"generate-types": "npx openapi-typescript cache/openapi-schema.json -o generated/types.ts",
14+
"postgenerate-types": "node scripts/update-package"
1915
},
20-
"release": {
21-
"branches": "main"
22-
}
16+
"devDependencies": { "openapi-typescript": "^2.4.2", "prettier": "^2.2.1" },
17+
"release": { "branches": "main" },
18+
"octokit": { "openapi-version": "1.0.1" }
2319
}

scripts/update-package.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const { writeFileSync } = require("fs");
2+
const prettier = require("prettier");
3+
4+
if (!process.env.VERSION) {
5+
throw new Error("VERSION is not set");
6+
}
7+
8+
const pkg = require("../package.json");
9+
10+
if (!pkg.octokit) {
11+
pkg.octokit = {};
12+
}
13+
14+
pkg.octokit["openapi-version"] = process.env.VERSION;
15+
16+
writeFileSync(
17+
"package.json",
18+
prettier.format(JSON.stringify(pkg), { parser: "json" })
19+
);

0 commit comments

Comments
 (0)