Skip to content

Conversation

@circlecube
Copy link
Member

Proposed changes

This rewrites the cypress test as a playwright test and sets up the workflow to run tests in the module PRs.

Type of Change

Production

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update

Visual

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@circlecube circlecube requested a review from a team November 3, 2025 22:49
@circlecube circlecube self-assigned this Nov 3, 2025
Comment on lines +15 to +26
name: Setup
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.extract_branch.outputs.branch }}
steps:

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

bluehost:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

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: {}

Copilot Autofix

AI 12 days ago

To fix this issue, you should add a permissions block to the workflow file, ideally at the top/root so it applies to all jobs, and grant the minimal necessary privileges. Given the jobs as shown only extract a branch name and call another workflow—actions that typically only require read access to repository content—set permissions: contents: read at the top of the file, just after name: (or after on: if you prefer), to follow least-privilege principles. If later you find specific jobs need more, you can override at the job level, but starting with contents: read is safest for CI/test flows.

The change is a one-line insertion at the root of the YAML workflow, likely after the name or on block.


Suggested changeset 1
.github/workflows/brand-plugin-test-playwright.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/brand-plugin-test-playwright.yml b/.github/workflows/brand-plugin-test-playwright.yml
--- a/.github/workflows/brand-plugin-test-playwright.yml
+++ b/.github/workflows/brand-plugin-test-playwright.yml
@@ -1,4 +1,6 @@
 name: Build and Test Module Updates in Brand Plugins (Playwright tests)
+permissions:
+  contents: read
 on:
   pull_request:
     types: [ opened, reopened, ready_for_review, synchronize ]
EOF
@@ -1,4 +1,6 @@
name: Build and Test Module Updates in Brand Plugins (Playwright tests)
permissions:
contents: read
on:
pull_request:
types: [ opened, reopened, ready_for_review, synchronize ]
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines 27 to 35
name: Bluehost Build and Test Playwright
needs: setup
uses: newfold-labs/workflows/.github/workflows/module-plugin-test-playwright.yml@add/playwright-module-test
with:
module-repo: ${{ github.repository }}
module-branch: ${{ needs.setup.outputs.branch }}
plugin-repo: 'newfold-labs/wp-plugin-bluehost'
plugin-branch: 'add/playwright'
secrets: inherit

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

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: {}

Copilot Autofix

AI 12 days ago

To fix the problem, we should add a permissions block explicitly to the workflow YAML file, specifying only the privileges necessary for the jobs. The best way to implement this is to set the block at the root level of the file (after the name: declaration and before jobs are declared) to apply least privilege to the entire workflow. If any job (such as the external reusable workflow in the bluehost job) needs write access to specific resources (e.g., pull-requests: write), you can add those to the list; otherwise, default to contents: read. The change applies only to .github/workflows/brand-plugin-test-playwright.yml.

No new imports or dependencies are needed, as this is a YAML configuration change.


Suggested changeset 1
.github/workflows/brand-plugin-test-playwright.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/brand-plugin-test-playwright.yml b/.github/workflows/brand-plugin-test-playwright.yml
--- a/.github/workflows/brand-plugin-test-playwright.yml
+++ b/.github/workflows/brand-plugin-test-playwright.yml
@@ -1,4 +1,6 @@
 name: Build and Test Module Updates in Brand Plugins (Playwright tests)
+permissions:
+  contents: read
 on:
   pull_request:
     types: [ opened, reopened, ready_for_review, synchronize ]
EOF
@@ -1,4 +1,6 @@
name: Build and Test Module Updates in Brand Plugins (Playwright tests)
permissions:
contents: read
on:
pull_request:
types: [ opened, reopened, ready_for_review, synchronize ]
Copilot is powered by AI and may make mistakes. Always verify output.
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

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