Skip to content

Commit 92d37e8

Browse files
authored
Merge branch 'main' into fix-readme-error
2 parents fc0fe14 + 60a0d83 commit 92d37e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+37253
-15053
lines changed

.eslintrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extends:
55
- eslint:recommended
66
- plugin:@typescript-eslint/eslint-recommended
77
- plugin:@typescript-eslint/recommended
8-
- prettier/@typescript-eslint
8+
- prettier
99
parserOptions:
1010
project: ['tsconfig.eslint.json']
1111
rules:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: 'Install dependencies'
2+
description: 'Set up node and install dependencies'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- uses: actions/setup-node@v3
7+
with:
8+
node-version: '20.x'
9+
cache: npm
10+
11+
- run: npm ci
12+
shell: bash

.github/workflows/check-dist.yml

+1-8
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v3
2222

23-
- name: Set Node.js 16.x
24-
uses: actions/setup-node@v3
25-
with:
26-
node-version: 16.x
27-
cache: npm
28-
29-
- name: Install dependencies
30-
run: npm ci
23+
- uses: ./.github/actions/install-dependencies
3124

3225
- name: Rebuild the dist/ directory
3326
run: npm run build

.github/workflows/ci.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v3
14-
- uses: actions/setup-node@v3
15-
with:
16-
node-version: 16
17-
cache: npm
18-
- run: npm ci
14+
- uses: ./.github/actions/install-dependencies
1915
- run: npm run style:check
2016
- run: npm test

.github/workflows/integration.yml

+83-28
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,7 @@ jobs:
5050
runs-on: ubuntu-latest
5151
steps:
5252
- uses: actions/checkout@v3
53-
- uses: actions/cache@v3
54-
with:
55-
path: ~/.npm
56-
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
57-
restore-keys: ${{runner.os}}-npm-
58-
- run: npm ci
53+
- uses: ./.github/actions/install-dependencies
5954
- id: npm-require
6055
uses: ./
6156
with:
@@ -71,23 +66,18 @@ jobs:
7166
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
7267
7368
test-previews:
74-
name: 'Integration test: previews option'
69+
name: 'Integration test: GraphQL previews option'
7570
runs-on: ubuntu-latest
7671
steps:
7772
- uses: actions/checkout@v3
78-
- uses: actions/cache@v3
79-
with:
80-
path: ~/.npm
81-
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
82-
restore-keys: ${{runner.os}}-npm-
83-
- run: npm ci
73+
- uses: ./.github/actions/install-dependencies
8474
- id: previews-default
8575
name: Default previews not set
8676
uses: ./
8777
with:
8878
script: |
8979
const endpoint = github.request.endpoint
90-
return endpoint({}).headers.accept
80+
return endpoint({url: "/graphql"}).headers.accept
9181
result-encoding: string
9282
- id: previews-set-single
9383
name: Previews set to a single value
@@ -96,7 +86,7 @@ jobs:
9686
previews: foo
9787
script: |
9888
const endpoint = github.request.endpoint
99-
return endpoint({}).headers.accept
89+
return endpoint({url: "/graphql"}).headers.accept
10090
result-encoding: string
10191
- id: previews-set-multiple
10292
name: Previews set to comma-separated list
@@ -105,7 +95,7 @@ jobs:
10595
previews: foo,bar,baz
10696
script: |
10797
const endpoint = github.request.endpoint
108-
return endpoint({}).headers.accept
98+
return endpoint({url: "/graphql"}).headers.accept
10999
result-encoding: string
110100
- run: |
111101
echo "- Validating previews default"
@@ -133,12 +123,7 @@ jobs:
133123
runs-on: ubuntu-latest
134124
steps:
135125
- uses: actions/checkout@v3
136-
- uses: actions/cache@v3
137-
with:
138-
path: ~/.npm
139-
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
140-
restore-keys: ${{runner.os}}-npm-
141-
- run: npm ci
126+
- uses: ./.github/actions/install-dependencies
142127
- id: user-agent-default
143128
name: Default user-agent not set
144129
uses: ./
@@ -195,12 +180,7 @@ jobs:
195180
runs-on: ubuntu-latest
196181
steps:
197182
- uses: actions/checkout@v3
198-
- uses: actions/cache@v3
199-
with:
200-
path: ~/.npm
201-
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
202-
restore-keys: ${{runner.os}}-npm-
203-
- run: npm ci
183+
- uses: ./.github/actions/install-dependencies
204184
- id: debug-default
205185
name: Default debug not set
206186
uses: ./
@@ -268,3 +248,78 @@ jobs:
268248
done <<< "$tests"
269249
270250
echo $'\u2705 Test passed' | tee -a $GITHUB_STEP_SUMMARY
251+
252+
test-base-url:
253+
name: 'Integration test: base-url option'
254+
runs-on: ubuntu-latest
255+
steps:
256+
- uses: actions/checkout@v3
257+
- uses: ./.github/actions/install-dependencies
258+
259+
- id: base-url-default
260+
name: API URL with base-url not set
261+
uses: ./
262+
with:
263+
script: |
264+
const endpoint = github.request.endpoint
265+
return endpoint({}).url
266+
result-encoding: string
267+
268+
- id: base-url-default-graphql
269+
name: GraphQL URL with base-url not set
270+
uses: ./
271+
with:
272+
script: |
273+
const endpoint = github.request.endpoint
274+
return endpoint({url: "/graphql"}).url
275+
result-encoding: string
276+
277+
- id: base-url-set
278+
name: API URL with base-url set
279+
uses: ./
280+
with:
281+
base-url: https://my.github-enterprise-server.com/api/v3
282+
script: |
283+
const endpoint = github.request.endpoint
284+
return endpoint({}).url
285+
result-encoding: string
286+
287+
- id: base-url-set-graphql
288+
name: GraphQL URL with base-url set
289+
uses: ./
290+
with:
291+
base-url: https://my.github-enterprise-server.com/api/v3
292+
script: |
293+
const endpoint = github.request.endpoint
294+
return endpoint({url: "/graphql"}).url
295+
result-encoding: string
296+
297+
- run: |
298+
echo "- Validating API URL default"
299+
expected="https://api.github.com/"
300+
actual="${{steps.base-url-default.outputs.result}}"
301+
if [[ "$expected" != "$actual" ]]; then
302+
echo $'::error::\u274C' "Expected base-url to equal '$expected', got $actual"
303+
exit 1
304+
fi
305+
echo "- Validating GraphQL URL default"
306+
expected="https://api.github.com/graphql"
307+
actual="${{steps.base-url-default-graphql.outputs.result}}"
308+
if [[ "$expected" != "$actual" ]]; then
309+
echo $'::error::\u274C' "Expected base-url to equal '$expected', got $actual"
310+
exit 1
311+
fi
312+
echo "- Validating base-url set to a value"
313+
expected="https://my.github-enterprise-server.com/api/v3/"
314+
actual="${{steps.base-url-set.outputs.result}}"
315+
if [[ "$expected" != "$actual" ]]; then
316+
echo $'::error::\u274C' "Expected base-url to equal '$expected', got $actual"
317+
exit 1
318+
fi
319+
echo "- Validating GraphQL URL with base-url set to a value"
320+
expected="https://my.github-enterprise-server.com/api/v3/graphql"
321+
actual="${{steps.base-url-set-graphql.outputs.result}}"
322+
if [[ "$expected" != "$actual" ]]; then
323+
echo $'::error::\u274C' "Expected base-url to equal '$expected', got $actual"
324+
exit 1
325+
fi

.github/workflows/licensed.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ jobs:
2020
- uses: jonabc/setup-licensed@82c5f4d19e8968efa74a25b132922382c2671fe2
2121
with:
2222
version: '3.x'
23-
- run: npm ci
23+
- uses: ./.github/actions/install-dependencies
2424
- run: licensed status

.licenses/npm/@actions/core.dep.yml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@actions/exec.dep.yml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@actions/github.dep.yml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@actions/glob.dep.yml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@actions/http-client.dep.yml

+18-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@actions/io.dep.yml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@fastify/busboy.dep.yml

+30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@octokit/auth-token.dep.yml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@octokit/core.dep.yml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@octokit/endpoint.dep.yml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@octokit/graphql.dep.yml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)