Skip to content

Commit 81f870c

Browse files
authored
Merge pull request #723 from acacode/update-gha
Update GitHub Actions
2 parents 3c676d6 + abeaa50 commit 81f870c

File tree

3 files changed

+105
-171
lines changed

3 files changed

+105
-171
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "npm"
4-
directory: "/"
5-
open-pull-requests-limit: 100
3+
- package-ecosystem: github-actions
4+
directory: /
65
schedule:
7-
interval: "daily"
6+
interval: weekly
7+
- package-ecosystem: npm
8+
directory: /
9+
schedule:
10+
interval: daily

.github/workflows/main.yml

Lines changed: 6 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -6,89 +6,20 @@ on:
66

77
jobs:
88
build-and-test:
9-
strategy:
10-
fail-fast: false
11-
matrix:
12-
os:
13-
- macos-latest
14-
- ubuntu-latest
15-
- windows-latest
16-
node-version:
17-
- 16.x
18-
- 18.x
19-
20-
runs-on: ${{ matrix.os }}
9+
runs-on: ubuntu-latest
2110

2211
steps:
2312
- name: Checkout tree
24-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
2514

26-
- name: Use Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v3
15+
- name: Set-up Node.js
16+
uses: actions/setup-node@v4
2817
with:
29-
node-version: ${{ matrix.node-version }}
18+
node-version: 22
19+
check-latest: true
3020

3121
- name: Install npm packages
3222
run: npm ci --ignore-scripts
3323

3424
- name: Run the tests
3525
run: npm run test-all
36-
37-
dependabot-auto-approve:
38-
name: Dependabot auto-approve
39-
40-
permissions:
41-
pull-requests: write
42-
43-
needs:
44-
- build-and-test
45-
46-
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }}
47-
48-
runs-on: ubuntu-latest
49-
50-
steps:
51-
- name: Fetch Dependabot metadata
52-
id: metadata
53-
uses: dependabot/fetch-metadata@v1
54-
55-
- name: Get the PR review decision
56-
id: gh-pr-review
57-
run: echo "decision=$(gh pr view --json reviewDecision --jq '. | .reviewDecision' "$PR_URL")" >>"$GITHUB_OUTPUT"
58-
env:
59-
PR_URL: ${{ github.event.pull_request.html_url }}
60-
GITHUB_TOKEN: ${{ github.token }}
61-
62-
- name: Approve a PR
63-
if: ${{ steps.gh-pr-review.outputs.decision != 'APPROVED' && steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
64-
run: gh pr review --approve "$PR_URL"
65-
env:
66-
PR_URL: ${{ github.event.pull_request.html_url }}
67-
GITHUB_TOKEN: ${{ github.token }}
68-
69-
dependabot-auto-merge:
70-
name: Dependabot auto-merge
71-
72-
permissions:
73-
contents: write
74-
pull-requests: write
75-
76-
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }}
77-
78-
needs:
79-
- build-and-test
80-
- dependabot-auto-approve
81-
82-
runs-on: ubuntu-latest
83-
84-
steps:
85-
- name: Fetch Dependabot metadata
86-
id: metadata
87-
uses: dependabot/fetch-metadata@v1
88-
89-
- name: Merge Dependabot PR
90-
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
91-
run: gh pr merge --auto --merge "$PR_URL"
92-
env:
93-
PR_URL: ${{ github.event.pull_request.html_url }}
94-
GITHUB_TOKEN: ${{ github.token }}

package.json

Lines changed: 92 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -2,91 +2,106 @@
22
"name": "swagger-typescript-api",
33
"version": "13.0.3",
44
"description": "Generate typescript/javascript api from swagger schema",
5+
"keywords": [
6+
"openapi",
7+
"swagger",
8+
"typescript",
9+
"api",
10+
"javascript",
11+
"rest",
12+
"codegen",
13+
"generation",
14+
"http"
15+
],
16+
"homepage": "https://github.com/acacode/swagger-typescript-api",
17+
"bugs": {
18+
"url": "https://github.com/acacode/swagger-typescript-api/issues"
19+
},
20+
"repository": {
21+
"type": "git",
22+
"url": "git://github.com/acacode/swagger-typescript-api"
23+
},
24+
"license": "MIT",
25+
"author": "acacode",
26+
"main": "src/index.js",
27+
"typings": "./index.d.ts",
28+
"bin": {
29+
"sta": "index.js",
30+
"swagger-typescript-api": "index.js"
31+
},
32+
"files": [
33+
"src",
34+
"index.js",
35+
"index.d.ts",
36+
"templates",
37+
"cli",
38+
"LICENSE"
39+
],
540
"scripts": {
6-
"update-deps-to-latest": "npx --yes npm-check-updates && npm i",
7-
"lint": "eslint .",
8-
"lint:fix": "eslint . --fix",
41+
"cli:help": "node index.js -h",
942
"cli:json": "node index.js -r -d -p ./swagger-test-cli.json -n swagger-test-cli.ts",
1043
"cli:yaml": "node index.js -r -d -p ./swagger-test-cli.yaml -n swagger-test-cli.ts",
44+
"contributors": "all-contributors generate",
45+
"generate": "node tests/generate.js",
46+
"generate-extended": "node tests/generate-extended.js",
47+
"lint": "eslint .",
48+
"lint:fix": "eslint . --fix",
1149
"node": "node swagger-test-cli/generate.js",
1250
"node:debug": "node --nolazy swagger-test-cli/generate.js",
13-
"contributors": "all-contributors generate",
14-
"cli:help": "node index.js -h",
1551
"test-all": "npm run test-extended && npm run test-simple && npm run test-specific",
1652
"test-all(update-snapshots)": "cross-env UPDATE_SNAPSHOTS=true npm run test-all",
17-
"test-simple": "node --unhandled-rejections=strict scripts_runner.js generate validate",
1853
"test-extended": "node --unhandled-rejections=strict scripts_runner.js generate-extended validate",
54+
"test-simple": "node --unhandled-rejections=strict scripts_runner.js generate validate",
1955
"test-specific": "node --unhandled-rejections=strict scripts_runner.js test:*",
2056
"test-specific(update-snapshots)": "cross-env UPDATE_SNAPSHOTS=true node --unhandled-rejections=strict scripts_runner.js test:*",
21-
"generate": "node tests/generate.js",
22-
"generate-extended": "node tests/generate-extended.js",
23-
"validate": "node tests/validate.js",
24-
"validate:debug": "node --nolazy tests/validate.js",
25-
"test:--route-types": "node tests/spec/routeTypes/test.js",
26-
"test:--no-client": "node tests/spec/noClient/test.js",
27-
"test:--default-as-success": "node tests/spec/defaultAsSuccess/test.js",
28-
"test:--templates": "node tests/spec/templates/test.js",
29-
"test:--union-enums": "node tests/spec/unionEnums/test.js",
3057
"test:--add-readonly": "node tests/spec/readonly/test.js",
31-
"test:--responses": "node tests/spec/responses/test.js",
32-
"test:specProperty": "node tests/spec/specProperty/test.js",
33-
"test:--module-name-index": "node tests/spec/moduleNameIndex/test.js",
34-
"test:--module-name-first-tag": "node tests/spec/moduleNameFirstTag/test.js",
35-
"test:--modular": "node tests/spec/modular/test.js",
36-
"test:--single-http-client": "node tests/spec/singleHttpClient/test.js",
37-
"test:--extract-request-params": "node tests/spec/extractRequestParams/test.js",
58+
"test:--another-array-type": "node tests/spec/another-array-type/test.js",
59+
"test:--axios": "node tests/spec/axios/test.js",
60+
"test:--axios--single-http-client": "node tests/spec/axiosSingleHttpClient/test.js",
61+
"test:--cli": "rimraf tests/spec/cli/schema.ts && node index.js -p tests/spec/cli/schema.json -o tests/spec/cli -n schema.ts --extract-response-body --extract-response-error --api-class-name MySuperApi --type-prefix Prefix && node tests/spec/cli/test.js",
62+
"test:--default-as-success": "node tests/spec/defaultAsSuccess/test.js",
63+
"test:--default-response": "node tests/spec/defaultResponse/test.js",
64+
"test:--dot-path-params": "node tests/spec/dot-path-params/test.js",
65+
"test:--enum-names-as-values": "node tests/spec/enumNamesAsValues/test.js",
3866
"test:--extract-request-body": "node tests/spec/extractRequestBody/test.js",
67+
"test:--extract-request-params": "node tests/spec/extractRequestParams/test.js",
3968
"test:--extract-response-body": "node tests/spec/extractResponseBody/test.js",
4069
"test:--extract-response-error": "node tests/spec/extractResponseError/test.js",
41-
"test:--enum-names-as-values": "node tests/spec/enumNamesAsValues/test.js",
42-
"test:--default-response": "node tests/spec/defaultResponse/test.js",
43-
"test:const-keyword": "node tests/spec/const-keyword/test.js",
4470
"test:--js": "node tests/spec/js/test.js",
45-
"test:jsSingleHttpClientModular": "node tests/spec/jsSingleHttpClientModular/test.js",
4671
"test:--js--axios": "node tests/spec/jsAxios/test.js",
47-
"test:--axios": "node tests/spec/axios/test.js",
48-
"test:--another-array-type": "node tests/spec/another-array-type/test.js",
72+
"test:--modular": "node tests/spec/modular/test.js",
73+
"test:--module-name-first-tag": "node tests/spec/moduleNameFirstTag/test.js",
74+
"test:--module-name-index": "node tests/spec/moduleNameIndex/test.js",
75+
"test:--no-client": "node tests/spec/noClient/test.js",
4976
"test:--object-types": "node tests/spec/object-types/test.js",
50-
"test:--axios--single-http-client": "node tests/spec/axiosSingleHttpClient/test.js",
51-
"test:--type-suffix--type-prefix": "node tests/spec/typeSuffixPrefix/test.js",
52-
"test:--dot-path-params": "node tests/spec/dot-path-params/test.js",
53-
"test:--primitive-type-constructs": "node tests/spec/primitive-type-constructs/test.js",
54-
"test:--cli": "rimraf tests/spec/cli/schema.ts && node index.js -p tests/spec/cli/schema.json -o tests/spec/cli -n schema.ts --extract-response-body --extract-response-error --api-class-name MySuperApi --type-prefix Prefix && node tests/spec/cli/test.js",
55-
"test:partialBaseTemplate": "node tests/spec/partialBaseTemplate/test.js",
56-
"test:partialDefaultTemplate": "node tests/spec/partialDefaultTemplate/test.js",
5777
"test:--patch": "node tests/spec/patch/test.js",
58-
"test:deprecated": "node tests/spec/deprecated/test.js",
59-
"test:nullableRefTest3.0": "node tests/spec/nullable-3.0/test.js",
60-
"test:nullableRefTest2.0": "node tests/spec/nullable-2.0/test.js",
78+
"test:--primitive-type-constructs": "node tests/spec/primitive-type-constructs/test.js",
79+
"test:--responses": "node tests/spec/responses/test.js",
80+
"test:--route-types": "node tests/spec/routeTypes/test.js",
81+
"test:--single-http-client": "node tests/spec/singleHttpClient/test.js",
82+
"test:--templates": "node tests/spec/templates/test.js",
83+
"test:--type-suffix--type-prefix": "node tests/spec/typeSuffixPrefix/test.js",
84+
"test:--union-enums": "node tests/spec/unionEnums/test.js",
6185
"test:additionalProperties2.0": "node tests/spec/additional-properties-2.0/test.js",
62-
"test:enums2.0": "node tests/spec/enums-2.0/test.js",
6386
"test:another-query-params": "node tests/spec/another-query-params/test.js",
64-
"test:on-insert-path-param": "node tests/spec/on-insert-path-param/test.js",
87+
"test:const-keyword": "node tests/spec/const-keyword/test.js",
88+
"test:deprecated": "node tests/spec/deprecated/test.js",
89+
"test:discriminator": "node tests/spec/discriminator/test.js",
90+
"test:enums2.0": "node tests/spec/enums-2.0/test.js",
6591
"test:extra-templates": "node tests/spec/extra-templates/test.js",
6692
"test:extract-enums": "node tests/spec/extract-enums/test.js",
67-
"test:discriminator": "node tests/spec/discriminator/test.js",
93+
"test:jsSingleHttpClientModular": "node tests/spec/jsSingleHttpClientModular/test.js",
94+
"test:nullableRefTest2.0": "node tests/spec/nullable-2.0/test.js",
95+
"test:nullableRefTest3.0": "node tests/spec/nullable-3.0/test.js",
96+
"test:on-insert-path-param": "node tests/spec/on-insert-path-param/test.js",
97+
"test:partialBaseTemplate": "node tests/spec/partialBaseTemplate/test.js",
98+
"test:partialDefaultTemplate": "node tests/spec/partialDefaultTemplate/test.js",
6899
"test:sort-types": "node tests/spec/sortTypes/test.js",
69-
"test:sort-types-false": "node tests/spec/sortTypes-false/test.js"
70-
},
71-
"author": "acacode",
72-
"license": "MIT",
73-
"typings": "./index.d.ts",
74-
"main": "src/index.js",
75-
"devDependencies": {
76-
"eslint": "^8.44.0",
77-
"eslint-config-prettier": "^8.8.0",
78-
"eslint-plugin-prettier": "^5.0.0",
79-
"@types/lodash": "^4.14.195",
80-
"@types/node": "^20.4.1",
81-
"@types/prettier": "^2.7.3",
82-
"all-contributors-cli": "^6.26.1",
83-
"axios": "^1.4.0",
84-
"cross-env": "^7.0.3",
85-
"dotenv": "^16.3.1",
86-
"git-diff": "^2.0.6",
87-
"husky": "^8.0.3",
88-
"pretty-quick": "^3.1.3",
89-
"rimraf": "^5.0.1"
100+
"test:sort-types-false": "node tests/spec/sortTypes-false/test.js",
101+
"test:specProperty": "node tests/spec/specProperty/test.js",
102+
"update-deps-to-latest": "npx --yes npm-check-updates && npm i",
103+
"validate": "node tests/validate.js",
104+
"validate:debug": "node --nolazy tests/validate.js"
90105
},
91106
"dependencies": {
92107
"@types/swagger-schema-official": "2.0.22",
@@ -104,35 +119,20 @@
104119
"swagger2openapi": "7.0.8",
105120
"typescript": "5.1.6"
106121
},
107-
"bin": {
108-
"swagger-typescript-api": "index.js",
109-
"sta": "index.js"
110-
},
111-
"keywords": [
112-
"openapi",
113-
"swagger",
114-
"typescript",
115-
"api",
116-
"javascript",
117-
"rest",
118-
"codegen",
119-
"generation",
120-
"http"
121-
],
122-
"files": [
123-
"src",
124-
"index.js",
125-
"index.d.ts",
126-
"templates",
127-
"cli",
128-
"LICENSE"
129-
],
130-
"bugs": {
131-
"url": "https://github.com/acacode/swagger-typescript-api/issues"
132-
},
133-
"homepage": "https://github.com/acacode/swagger-typescript-api",
134-
"repository": {
135-
"type": "git",
136-
"url": "git://github.com/acacode/swagger-typescript-api"
122+
"devDependencies": {
123+
"@types/lodash": "^4.14.195",
124+
"@types/node": "^20.4.1",
125+
"@types/prettier": "^2.7.3",
126+
"all-contributors-cli": "^6.26.1",
127+
"axios": "^1.4.0",
128+
"cross-env": "^7.0.3",
129+
"dotenv": "^16.3.1",
130+
"eslint": "^8.44.0",
131+
"eslint-config-prettier": "^8.8.0",
132+
"eslint-plugin-prettier": "^5.0.0",
133+
"git-diff": "^2.0.6",
134+
"husky": "^8.0.3",
135+
"pretty-quick": "^3.1.3",
136+
"rimraf": "^5.0.1"
137137
}
138138
}

0 commit comments

Comments
 (0)