Skip to content

Conversation

romainmenke
Copy link
Member

@romainmenke romainmenke commented Sep 14, 2024

Which issue, if any, is this issue related to?

See #39

Is there anything in the PR that needs further explanation?

Blocked on WordPress/gutenberg#59933

Gutenberg uses a bespoke setup to emulate workspaces.
I would like to avoid adding support for their custom setup and instead wait until they align with standard npm workspaces.

@romainmenke romainmenke marked this pull request as draft September 14, 2024 07:39
@ybiquitous
Copy link
Member

I would like to avoid adding support for their custom setup

Agree. Let's wait for upstream improvement.

@Mouvedia
Copy link
Member

see also WordPress/gutenberg#65681

@romainmenke
Copy link
Member Author

Thank you for linking that @Mouvedia
Nice to see that this is something they are actively working on.

@Mouvedia
Copy link
Member

WordPress/gutenberg#66272 has been merged.

@romainmenke
Copy link
Member Author

Tests for the WordPress Stylelint config are now working.
They are failing, but these are actual test failures 🎉

stylelint-version-override:
type: string
description: The Stylelint version override
working-directory-is-workspace:
Copy link
Member Author

@romainmenke romainmenke Jan 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm workspaces often assume that npm install and other commands are run from the project root.

Comment on lines +22 to +29
uses: ./.github/workflows/test-package.yml
name: latest
with:
package: '@wordpress/stylelint-config'
stylelint-version: stylelint@latest
working-directory-is-workspace: true
build-command: exit 0
test-command: npm run test:unit -- --testPathPattern packages/stylelint-config

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

Copilot Autofix

AI about 2 months ago

To fix the problem, add a permissions block to the workflow file. This block should be placed at the root level (recommended), so it applies to all jobs unless overridden. The minimal safe default is contents: read, which allows the workflow to read repository contents but not write to them. If the workflow or any called workflow requires additional permissions, those can be added as needed. In this case, since the workflow appears to only run tests and does not seem to require write access, contents: read is appropriate. The change should be made at the top level of .github/workflows/test-package-wordpress-stylelint-config-54e.latest.yml, after the name: and before on:.

Suggested changeset 1
.github/workflows/test-package-wordpress-stylelint-config-54e.latest.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-package-wordpress-stylelint-config-54e.latest.yml b/.github/workflows/test-package-wordpress-stylelint-config-54e.latest.yml
--- a/.github/workflows/test-package-wordpress-stylelint-config-54e.latest.yml
+++ b/.github/workflows/test-package-wordpress-stylelint-config-54e.latest.yml
@@ -1,2 +1,4 @@
 name: '@wordpress/stylelint-config'
+permissions:
+  contents: read
 on:
EOF
@@ -1,2 +1,4 @@
name: '@wordpress/stylelint-config'
permissions:
contents: read
on:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +21 to +28
uses: ./.github/workflows/test-package.yml
name: next
with:
package: '@wordpress/stylelint-config'
stylelint-version: stylelint/stylelint
working-directory-is-workspace: true
build-command: exit 0
test-command: npm run test:unit -- --testPathPattern packages/stylelint-config

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

Copilot Autofix

AI about 2 months ago

To fix the problem, you should add a permissions block to the workflow file .github/workflows/test-package-wordpress-stylelint-config-54e.next.yml. The block should be placed at the root level (above jobs:) to apply to all jobs in the workflow, unless a job overrides it. The minimal starting point is usually contents: read, which is sufficient for most workflows that do not need to write to the repository. If the workflow or any called workflow requires additional permissions (e.g., to create pull requests or issues), you can add those as needed. In this case, since the workflow appears to be running tests and not performing write operations, contents: read is likely sufficient.

Suggested changeset 1
.github/workflows/test-package-wordpress-stylelint-config-54e.next.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-package-wordpress-stylelint-config-54e.next.yml b/.github/workflows/test-package-wordpress-stylelint-config-54e.next.yml
--- a/.github/workflows/test-package-wordpress-stylelint-config-54e.next.yml
+++ b/.github/workflows/test-package-wordpress-stylelint-config-54e.next.yml
@@ -1,2 +1,4 @@
 name: '@wordpress/stylelint-config'
+permissions:
+  contents: read
 on:
EOF
@@ -1,2 +1,4 @@
name: '@wordpress/stylelint-config'
permissions:
contents: read
on:
Copilot is powered by AI and may make mistakes. Always verify output.
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.

3 participants