Skip to content

Per fixing regression#2148

Merged
prklm10 merged 3 commits intomasterfrom
PER-fixing-regression
Mar 15, 2026
Merged

Per fixing regression#2148
prklm10 merged 3 commits intomasterfrom
PER-fixing-regression

Conversation

@prklm10
Copy link
Copy Markdown
Contributor

@prklm10 prklm10 commented Mar 15, 2026

Per fixing regression

@prklm10 prklm10 requested a review from a team as a code owner March 15, 2026 08:01
Comment on lines +93 to +135
name: Regression
needs: [build]
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 50
- uses: actions/setup-node@v3
with:
node-version: 14
- uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
packages/core/.local-chromium
key: >
${{ runner.os }}/node-14/
${{ hashFiles('.github/.cache-key') }}/
${{ hashFiles('**/yarn.lock') }}
restore-keys: >
${{ runner.os }}/node-14/
${{ hashFiles('.github/.cache-key') }}/
- uses: actions/download-artifact@v5
with:
name: dist
path: packages
- run: yarn
- name: Install browser dependencies
run: |
sudo apt-get update
sudo apt-get install -y --fix-missing libgbm-dev
- name: Set up @percy/cli
run: |
PERCY_PACKAGES=$(find packages -mindepth 1 -maxdepth 1 -type d | sed -e 's/packages/@percy/g' | tr '\n' ' ')
yarn global:link
yarn link `echo $PERCY_PACKAGES`
npx percy --version
- name: Run regression tests
run: yarn test:regression
env:
PERCY_TOKEN: ${{ secrets.PERCY_REGRESSION_TOKEN }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium test

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 17 days ago

To fix the problem, explicitly declare least‑privilege GITHUB_TOKEN permissions in the workflow. Since none of the jobs appear to perform repository write operations (no git push, no changes to PRs, etc.), they only need read access to repository contents. The simplest and safest solution is to add a root‑level permissions: block with contents: read, which will apply to all jobs that do not override it.

Concretely, in .github/workflows/test.yml, add a new permissions: section between the on: block and the jobs: block. For example, insert:

permissions:
  contents: read

after line 6 (the last line of the on: triggers). This preserves existing behavior (all actions continue to work, since they only need to read code and metadata) while ensuring the GITHUB_TOKEN cannot write to repository contents. No imports, methods, or other definitions are needed, since this is a YAML configuration change only.

Suggested changeset 1
.github/workflows/test.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -4,6 +4,8 @@
     branches: [master]
   pull_request:
   workflow_dispatch:
+permissions:
+  contents: read
 jobs:
   build:
     name: Build
EOF
@@ -4,6 +4,8 @@
branches: [master]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build
Copilot is powered by AI and may make mistakes. Always verify output.
@prklm10 prklm10 merged commit ba807ab into master Mar 15, 2026
42 checks passed
@prklm10 prklm10 deleted the PER-fixing-regression branch March 15, 2026 13:01
rishigupta1599 pushed a commit that referenced this pull request Mar 16, 2026
* docs: Remove note about issue_comment trigger dependency on default branch

* refactor: simplify regression workflow by removing issue_comment triggers and related steps

* feat: add regression workflow to test.yml with updated steps and dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants