chore: add permissions and improve code

This commit is contained in:
Alex Varchuk 2025-12-16 16:07:03 +02:00
parent 3bcffe3ad0
commit 33f9525a7a
No known key found for this signature in database
GPG Key ID: 8A9260AE529FF454
9 changed files with 14 additions and 5 deletions

View File

@ -10,6 +10,8 @@ on:
required: true
permissions:
contents: read
packages: write
jobs:
docker:
runs-on: ubuntu-latest

View File

@ -5,6 +5,9 @@ on:
branches:
- main
permissions:
contents: read
jobs:
build-and-e2e:
runs-on: ubuntu-latest

View File

@ -46,6 +46,7 @@ jobs:
permissions:
contents: read
packages: write
actions: write
uses: ./.github/workflows/docker.yml
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}

View File

@ -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

View File

@ -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": {

View File

@ -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 {

View File

@ -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;
}
}

View File

@ -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;
}
}