-
Notifications
You must be signed in to change notification settings - Fork 11
Steve/v3-data-attrs #4812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Steve/v3-data-attrs #4812
Conversation
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Cleanup | ||
| run: | | ||
| gh extension install actions/gh-actions-cache | ||
|
|
||
| echo "Fetching list of cache key" | ||
| cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 ) | ||
|
|
||
| ## Setting this to not fail the workflow while deleting cache keys. | ||
| set +e | ||
| echo "Deleting caches..." | ||
| for cacheKey in $cacheKeysForPR | ||
| do | ||
| gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm | ||
| done | ||
| echo "Done" | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| REPO: ${{ github.repository }} | ||
| BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 months ago
To fix this problem, we should add an explicit permissions: block to the workflow's sole job (cleanup). This block should set the least privileges needed for the workflow steps to function. In this case, since the job installs and invokes the gh-actions-cache extension (which deletes caches), the workflow needs write access to the GitHub Actions caches via the actions scope—so actions: write is required. There is no evidence it needs any other permissions (like contents, pull-requests, etc.) for its purpose.
This change should be made inside the job definition (under jobs.cleanup:), inserted before or after runs-on: (as per GitHub Actions YAML conventions). No new imports, methods or definitions are needed.
-
Copy modified lines R10-R11
| @@ -7,6 +7,8 @@ | ||
| jobs: | ||
| cleanup: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: write | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v3 #4812 +/- ##
=======================================
Coverage 95.20% 95.20%
=======================================
Files 212 212
Lines 9317 9319 +2
Branches 1792 1793 +1
=======================================
+ Hits 8870 8872 +2
Misses 328 328
Partials 119 119
🚀 New features to boost your workflow:
|
next-core
|
||||||||||||||||||||||||||||
| Project |
next-core
|
| Branch Review |
steve/v3-data-attrs
|
| Run status |
|
| Run duration | 00m 24s |
| Commit |
|
| Committer | Shenwei Wang |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
17
|
| View all changes introduced in this branch ↗︎ | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for setting HTML data attributes (e.g., data-test, data-info) directly on elements by checking for the data- prefix and using setAttribute instead of property assignment.
Key Changes
- Modified
setRealPropertiesto detect properties starting withdata-and set them as HTML attributes usingsetAttribute - Added test coverage for the new data attribute functionality
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/runtime/src/internal/compute/setRealProperties.ts | Added conditional logic to handle data- prefixed properties as HTML attributes |
| packages/runtime/src/internal/compute/setRealProperties.spec.ts | Added test case to verify data attributes are correctly set on elements |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
依赖检查
组件之间的依赖声明,是微服务组件架构下的重要信息,请确保其正确性。
请勾选以下两组选项其中之一:
或者:
提交信息检查
Git 提交信息将决定包的版本发布及自动生成的 CHANGELOG,请检查工作内容与提交信息是否相符,并在以下每组选项中都依次确认。
破坏性变更:
feat作为提交类型。BREAKING CHANGE: 你的变更说明。新特性:
feat作为提交类型。问题修复:
fix作为提交类型。杂项工作:
即所有对下游使用者无任何影响、且没有必要显示在 CHANGELOG 中的改动,例如修改注释、测试用例、开发文档等:
chore,docs,test等作为提交类型。