mirror of
https://github.com/Redocly/redoc.git
synced 2026-01-04 15:33:06 +03:00
chore: add permissions and improve code
This commit is contained in:
parent
3bcffe3ad0
commit
33f9525a7a
2
.github/workflows/docker.yml
vendored
2
.github/workflows/docker.yml
vendored
|
|
@ -10,6 +10,8 @@ on:
|
|||
required: true
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
3
.github/workflows/e2e.yml
vendored
3
.github/workflows/e2e.yml
vendored
|
|
@ -5,6 +5,9 @@ on:
|
|||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-and-e2e:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
|
|
@ -46,6 +46,7 @@ jobs:
|
|||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
actions: write
|
||||
uses: ./.github/workflows/docker.yml
|
||||
secrets:
|
||||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
|
|
|
|||
3
.github/workflows/unit-tests.yml
vendored
3
.github/workflows/unit-tests.yml
vendored
|
|
@ -5,6 +5,9 @@ on:
|
|||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-and-unit:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 4.2 KiB |
|
|
@ -58,7 +58,7 @@
|
|||
"list:licenses": "node ./scripts/list-licenses.js",
|
||||
"license:check": "npx license-checker --production --onlyAllow 'MIT;ISC;Apache-2.0;BSD;BSD-2-Clause;BSD-3-Clause;CC-BY-4.0;CC0-1.0;Python-2.0 ' --summary",
|
||||
"changeset": "npx @changesets/cli --",
|
||||
"release": "npm run build && npm run changeset publish",
|
||||
"release": "npm run build && npm run changeset publish --tag next",
|
||||
"publish-cdn": "scripts/publish-cdn.sh"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
|||
|
|
@ -153,8 +153,8 @@ export function escapeHTMLAttrChars(str: string): string {
|
|||
export function unescapeHTMLChars(str: string): string {
|
||||
return str
|
||||
.replace(/&#(\d+);/g, (_m, code) => String.fromCharCode(parseInt(code, 10)))
|
||||
.replace(/&/g, '&')
|
||||
.replace(/"/g, '"');
|
||||
.replace(/"/g, '"')
|
||||
.replace(/&/g, '&');
|
||||
}
|
||||
|
||||
export function sanitizeItemId(id: string): string {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ export function tryDecodeURIComponent(str: string): string {
|
|||
try {
|
||||
return decodeURIComponent(str);
|
||||
} catch (e) {
|
||||
console.error(`Decoding failed: ${str}`, e);
|
||||
console.error('Decoding failed: %s', str, e);
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export function urlParse(url: string, slashesDenoteHost = false): URL | null {
|
|||
try {
|
||||
return URL?.parse ? URL?.parse(processedUrl) : new URL(processedUrl);
|
||||
} catch (error) {
|
||||
console.error(`Invalid URL: ${processedUrl}`, error);
|
||||
console.error('Invalid URL: %s', processedUrl, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user