From 2b46b5409be64dd5142bdf3c34fbd90cd94c43f4 Mon Sep 17 00:00:00 2001 From: Midga3 Date: Tue, 10 Nov 2026 18:59:38 +0300 Subject: [PATCH 1/5] Unsafe innerHTML checker for prs --- .github/workflows/innerHTML.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/innerHTML.yml diff --git a/.github/workflows/innerHTML.yml b/.github/workflows/innerHTML.yml new file mode 100644 index 000000000..1a1bc8bfc --- /dev/null +++ b/.github/workflows/innerHTML.yml @@ -0,0 +1,27 @@ +name: Unsafe innerHTML checker +on: [pull_request] + +jobs: + eslint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: { node-version: 20, cache: npm } + - run: npm ci + - id: changed + uses: tj-actions/changed-files@v45 + with: + files: | + **/*.js + - if: steps.changed.outputs.any_changed == 'true' + run: | + set +e + OUTPUT=$(npx eslint ${{ steps.changed.outputs.all_changed_files }} 2>&1) + set -e + echo "$OUTPUT" + if echo "$OUTPUT" | grep -q "Unsafe innerHTML"; then + echo "::error::Unsafe innerHTML found in this pr" + exit 1 + fi + echo "No innerHTML issues" From 6550c25b071aa8614bc318eaec59df4c82f6b46b Mon Sep 17 00:00:00 2001 From: Midga3 Date: Tue, 10 Nov 2026 19:35:55 +0300 Subject: [PATCH 2/5] Not only js --- .github/workflows/innerHTML.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/innerHTML.yml b/.github/workflows/innerHTML.yml index 1a1bc8bfc..1307e3138 100644 --- a/.github/workflows/innerHTML.yml +++ b/.github/workflows/innerHTML.yml @@ -14,6 +14,12 @@ jobs: with: files: | **/*.js + **/*.jsx + **/*.ts + **/*.tsx + **/*.mjs + **/*.cjs + - if: steps.changed.outputs.any_changed == 'true' run: | set +e From 3730b388efb6c4cb6f1f2eb40f8c5cc5b2690fcf Mon Sep 17 00:00:00 2001 From: Midga3 Date: Tue, 10 Nov 2026 22:04:24 +0300 Subject: [PATCH 3/5] Updated to prs.yml and added new checks --- .github/workflows/innerHTML.yml | 33 ------------ .github/workflows/prs.yml | 92 +++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/innerHTML.yml create mode 100644 .github/workflows/prs.yml diff --git a/.github/workflows/innerHTML.yml b/.github/workflows/innerHTML.yml deleted file mode 100644 index 1307e3138..000000000 --- a/.github/workflows/innerHTML.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Unsafe innerHTML checker -on: [pull_request] - -jobs: - eslint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: { node-version: 20, cache: npm } - - run: npm ci - - id: changed - uses: tj-actions/changed-files@v45 - with: - files: | - **/*.js - **/*.jsx - **/*.ts - **/*.tsx - **/*.mjs - **/*.cjs - - - if: steps.changed.outputs.any_changed == 'true' - run: | - set +e - OUTPUT=$(npx eslint ${{ steps.changed.outputs.all_changed_files }} 2>&1) - set -e - echo "$OUTPUT" - if echo "$OUTPUT" | grep -q "Unsafe innerHTML"; then - echo "::error::Unsafe innerHTML found in this pr" - exit 1 - fi - echo "No innerHTML issues" diff --git a/.github/workflows/prs.yml b/.github/workflows/prs.yml new file mode 100644 index 000000000..ba70f3f28 --- /dev/null +++ b/.github/workflows/prs.yml @@ -0,0 +1,92 @@ +name: PR Guidlines check +on: [pull_request] + +jobs: + eslint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: { node-version: 20, cache: npm } + - run: npm ci + - id: changed + uses: tj-actions/changed-files@v45 + with: + files: | + **/*.js + **/*.jsx + **/*.ts + **/*.tsx + **/*.mjs + **/*.cjs + + - if: steps.changed.outputs.any_changed == 'true' + run: | + set +e + OUTPUT=$(npx eslint ${{ steps.changed.outputs.all_changed_files }} 2>&1) + set -e + echo "$OUTPUT" + if echo "$OUTPUT" | grep -q "Unsafe innerHTML"; then + echo "::error::Unsafe innerHTML found in this pr" + exit 1 + fi + echo "No innerHTML issues" + + permissions: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: { fetch-depth: 0 } + - uses: actions/setup-node@v4 + with: { node-version: 20 } + - run: | + git fetch -q origin ${{ github.base_ref }} --depth=1 + for f in $(git ls-files | grep -E '(^|/)manifest\.json$' | grep -v node_modules); do + node -e ' + const b=JSON.parse(require("fs").readFileSync(0)), h=JSON.parse(require("fs").readFileSync(process.argv[1])); + const k=["permissions","host_permissions","optional_permissions","optional_host_permissions"]; + const a=k.flatMap(x=>(h[x]||[]).filter(y=>!(b[x]||[]).includes(y)).map(y=>`${x}: ${y}`)); + if(a.length){console.log("ADDED:\n + "+a.join("\n + "));process.exit(2)} + ' "$f" < <(git show origin/${{ github.base_ref }}:$f) || { echo "::error file=$f::new permissions"; exit 1; } + done + + links: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - id: changed + uses: tj-actions/changed-files@v45 + with: + files: | + **/*.js + **/*.jsx + **/*.ts + **/*.tsx + **/*.mjs + **/*.cjs + **/*.json + **/*.html + **/*.md + - if: steps.changed.outputs.any_changed == 'true' + run: | + git fetch -q origin ${{ github.base_ref }} --depth=1 + BAD=0 + for f in ${{ steps.changed.outputs.all_changed_files }}; do + while read host; do + [ -z "$host" ] && continue + if ! echo "$host" | grep -qE '(^|\.)(rovalra|roblox)\.com$'; then + echo "::error file=$f::Disallowed link host: $host" + BAD=1 + fi + done < <( + git diff -U0 origin/${{ github.base_ref }} -- "$f" \ + | grep -E '^\+' \ + | grep -oE 'https?://[^ "'"'"')<>]+' \ + | sed -E 's#https?://##; s#[/?#].*##' \ + | sort -u + ) + done + [ "$BAD" = "1" ] && exit 1 + echo "All links OK" From 0757679a1024ddf4bd87154bfb429c52427faab5 Mon Sep 17 00:00:00 2001 From: Midga3 Date: Tue, 10 Nov 2026 22:17:16 +0300 Subject: [PATCH 4/5] Refine permissions check and update disallowed hosts --- .github/workflows/prs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prs.yml b/.github/workflows/prs.yml index ba70f3f28..eb2de3333 100644 --- a/.github/workflows/prs.yml +++ b/.github/workflows/prs.yml @@ -44,7 +44,7 @@ jobs: for f in $(git ls-files | grep -E '(^|/)manifest\.json$' | grep -v node_modules); do node -e ' const b=JSON.parse(require("fs").readFileSync(0)), h=JSON.parse(require("fs").readFileSync(process.argv[1])); - const k=["permissions","host_permissions","optional_permissions","optional_host_permissions"]; + const k=["permissions","host_permissions"]; const a=k.flatMap(x=>(h[x]||[]).filter(y=>!(b[x]||[]).includes(y)).map(y=>`${x}: ${y}`)); if(a.length){console.log("ADDED:\n + "+a.join("\n + "));process.exit(2)} ' "$f" < <(git show origin/${{ github.base_ref }}:$f) || { echo "::error file=$f::new permissions"; exit 1; } @@ -76,7 +76,7 @@ jobs: for f in ${{ steps.changed.outputs.all_changed_files }}; do while read host; do [ -z "$host" ] && continue - if ! echo "$host" | grep -qE '(^|\.)(rovalra|roblox)\.com$'; then + if ! echo "$host" | grep -qE '(^|\.)(rovalra|roblox|rbxcdn)\.com$'; then echo "::error file=$f::Disallowed link host: $host" BAD=1 fi From fb897fba6e3f4616812d4bd9bd3ef076b8af975d Mon Sep 17 00:00:00 2001 From: Midga3 Date: Tue, 10 Nov 2026 23:00:15 +0300 Subject: [PATCH 5/5] Fix deprecation warning --- .github/workflows/prs.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/prs.yml b/.github/workflows/prs.yml index eb2de3333..77d77efa2 100644 --- a/.github/workflows/prs.yml +++ b/.github/workflows/prs.yml @@ -5,12 +5,12 @@ jobs: eslint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 with: { node-version: 20, cache: npm } - run: npm ci - id: changed - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@v47 with: files: | **/*.js @@ -19,7 +19,6 @@ jobs: **/*.tsx **/*.mjs **/*.cjs - - if: steps.changed.outputs.any_changed == 'true' run: | set +e @@ -35,9 +34,9 @@ jobs: permissions: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: { fetch-depth: 0 } - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: { node-version: 20 } - run: | git fetch -q origin ${{ github.base_ref }} --depth=1 @@ -53,11 +52,11 @@ jobs: links: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 - id: changed - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@v47 with: files: | **/*.js