Skip to content

Conversation

@0xnullifier
Copy link
Collaborator

Closes 0xMiden/feedback#121

This is how the extra step looks like
image

Content is subject to change

@0xnullifier 0xnullifier marked this pull request as draft January 16, 2026 13:12
@0xnullifier
Copy link
Collaborator Author

0xnullifier commented Jan 18, 2026

Builds on top of #78 and #76

Comment on lines 58 to 106
name: Test
needs: translations
# Skip if translations committed - new workflow run will handle it
if: needs.translations.outputs.committed != 'true'
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@v3

- name: Use Node 20
uses: actions/setup-node@v3
with:
node-version: 20

- name: Run Install
uses: borales/actions-yarn@v4
with:
cmd: install

- name: Run ESLint
uses: borales/actions-yarn@v4
with:
cmd: lint

- name: Run TypeScript Check
uses: borales/actions-yarn@v4
with:
cmd: ts

- name: Run Unit Tests
uses: borales/actions-yarn@v4
with:
cmd: test

- name: Install Chrome
uses: browser-actions/setup-chrome@v1

- name: Build chrome
uses: borales/actions-yarn@v4
with:
cmd: build:chrome

- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium

- name: Run Playwright E2E
run: xvfb-run -a yarn test:e2e

coverage:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions

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 10 days ago

To fix this, add an explicit permissions block that follows least privilege. The simplest and safest approach is:

  • At the workflow (top) level, set permissions: contents: read to cover the CI-style jobs that only need to read code and run tests (ci, coverage, i18n-check).
  • For the translations job, override permissions with a job-level permissions block that allows writing to repository contents so that git push works, while keeping other scopes at default minimal levels (i.e., unspecified and thus effectively none).

Concretely:

  • Edit .github/workflows/pr.yml.
  • After the name: PR Tests line, add a top-level permissions: block with contents: read.
  • Under the translations: job (same indentation level as name, runs-on), add a permissions: block with contents: write.

This keeps existing functionality: translations can still commit and push translation updates, while the rest of the jobs have only read access to repo contents. No other imports or definitions are needed, as this is pure YAML configuration for GitHub Actions.

Suggested changeset 1
.github/workflows/pr.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/pr.yml b/.github/workflows/pr.yml
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -1,5 +1,8 @@
 name: PR Tests
 
+permissions:
+  contents: read
+
 on:
   pull_request:
     branches:
@@ -13,6 +16,8 @@
   translations:
     name: Update Translation Files
     runs-on: ubuntu-latest
+    permissions:
+      contents: write
     outputs:
       committed: ${{ steps.commit.outputs.committed }}
     steps:
EOF
@@ -1,5 +1,8 @@
name: PR Tests

permissions:
contents: read

on:
pull_request:
branches:
@@ -13,6 +16,8 @@
translations:
name: Update Translation Files
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
committed: ${{ steps.commit.outputs.committed }}
steps:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Comment on lines 107 to 131
name: Coverage Check (80% minimum)
needs: translations
# Skip if translations committed - new workflow run will handle it
if: needs.translations.outputs.committed != 'true'
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@v3

- name: Use Node 20
uses: actions/setup-node@v3
with:
node-version: 20

- name: Run Install
uses: borales/actions-yarn@v4
with:
cmd: install

- name: Run Coverage Check
uses: borales/actions-yarn@v4
with:
cmd: test:coverage

i18n-check:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions

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 10 days ago

In general, the problem is fixed by explicitly specifying a permissions: block for the workflow or for individual jobs, granting only the minimal scopes needed. Since all of the shown jobs only need to read the repository contents (via actions/checkout) and do not perform any write operations back to GitHub, setting contents: read is sufficient and aligns with the CodeQL “minimal starting point” suggestion.

The best way to fix this without changing existing functionality is to add a top‑level permissions: block right under the workflow name: and before the on: key in .github/workflows/pr.yml. This way, the permission setting applies to all jobs that do not override it (which includes translations, ci, coverage, and i18n-check as shown). Concretely, you should insert:

permissions:
  contents: read

between the existing line name: PR Tests and the on: block. No changes are needed inside the individual jobs, and no imports or additional methods are required since this is purely a workflow configuration change.

Suggested changeset 1
.github/workflows/pr.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/pr.yml b/.github/workflows/pr.yml
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -1,5 +1,8 @@
 name: PR Tests
 
+permissions:
+  contents: read
+
 on:
   pull_request:
     branches:
EOF
@@ -1,5 +1,8 @@
name: PR Tests

permissions:
contents: read

on:
pull_request:
branches:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Comment on lines 132 to 151
name: Check for non-i18n'd strings
needs: translations
# Skip if translations committed - new workflow run will handle it
if: needs.translations.outputs.committed != 'true'
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Check i18n compliance
run: yarn lint:i18n

Check warning

Code scanning / CodeQL

Workflow does not contain permissions

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 10 days ago

In general, the fix is to add an explicit permissions block to the workflow and/or individual jobs so that the GITHUB_TOKEN has only the minimal scopes required. Jobs that don’t need to modify repository contents (like ci, coverage, and i18n-check) should have contents: read. The translations job, which commits and pushes generated translation files back to the repo, needs contents: write.

The cleanest way to do this without changing behavior is:

  • Add a workflow-level permissions: contents: read so that all jobs default to read-only.
  • Override the translations job with permissions: contents: write so it can still push changes.
    This addresses the CodeQL warning (including for i18n-check) and enforces least privilege. No additional imports or external dependencies are required; all changes are within .github/workflows/pr.yml.

Concretely:

  • Edit .github/workflows/pr.yml near the top to add:
permissions:
  contents: read

right after the name: PR Tests (and before on:).

  • Edit the translations job definition to add:
permissions:
  contents: write

between runs-on: ubuntu-latest and outputs:.

Suggested changeset 1
.github/workflows/pr.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/pr.yml b/.github/workflows/pr.yml
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -1,5 +1,8 @@
 name: PR Tests
 
+permissions:
+  contents: read
+
 on:
   pull_request:
     branches:
@@ -13,6 +16,8 @@
   translations:
     name: Update Translation Files
     runs-on: ubuntu-latest
+    permissions:
+      contents: write
     outputs:
       committed: ${{ steps.commit.outputs.committed }}
     steps:
EOF
@@ -1,5 +1,8 @@
name: PR Tests

permissions:
contents: read

on:
pull_request:
branches:
@@ -13,6 +16,8 @@
translations:
name: Update Translation Files
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
committed: ${{ steps.commit.outputs.committed }}
steps:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@0xnullifier 0xnullifier changed the base branch from main to utk-enable-privkey-export-import January 19, 2026 06:40
@0xnullifier 0xnullifier force-pushed the utk-enable-privkey-export-import branch 3 times, most recently from 65c3de8 to adff944 Compare January 22, 2026 06:36
@0xnullifier 0xnullifier force-pushed the utk-feat-add-auth-scheme branch from 4386ca1 to a6a5b93 Compare January 22, 2026 10:54
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.

Support ECDSA auth scheme

2 participants