Skip to content

Minor refactor + Add rector#47

Merged
vjik merged 2 commits intomasterfrom
rector
Sep 23, 2025
Merged

Minor refactor + Add rector#47
vjik merged 2 commits intomasterfrom
rector

Conversation

@vjik
Copy link
Member

@vjik vjik commented Sep 23, 2025

Q A
Is bugfix?
New feature?
Breaks BC?

@codecov
Copy link

codecov bot commented Sep 23, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.23%. Comparing base (7d060fc) to head (03716d9).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/RequestBodyParser.php 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #47      +/-   ##
============================================
- Coverage     95.40%   95.23%   -0.17%     
  Complexity       34       34              
============================================
  Files             3        3              
  Lines            87       84       -3     
============================================
- Hits             83       80       -3     
  Misses            4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +16 to +24
uses: yiisoft/actions/.github/workflows/rector.yml@master
secrets:
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
os: >-
['ubuntu-latest']
php: >-
['8.4']

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 5 months ago

To fix this problem, the workflow should explicitly set the permissions block at the workflow or job level, specifying the minimum required access for the workflow to function. In the most secure configuration, set permissions: contents: read at the root, or within the specific job if different jobs have different needs. Because this workflow largely delegates to an external reusable workflow (via uses), the safest generic policy is to provide only read access unless a more specific write access is proven necessary for this action to work. The recommended best practice is to add a permissions block at the job level (right under the rector job—next to uses and with). By doing so, we minimize the token’s permissions for this job only, and can later expand them if downstream linter/rector steps require it.

To implement the fix:

  • Insert the following block directly after the job name (rector:) or before uses:
    permissions:
      contents: read
  • If future requirements necessitate additional permissions (e.g., pull-requests: write), they can be added as new lines under permissions.

Suggested changeset 1
.github/workflows/rector.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/rector.yml b/.github/workflows/rector.yml
--- a/.github/workflows/rector.yml
+++ b/.github/workflows/rector.yml
@@ -13,6 +13,8 @@
 
 jobs:
   rector:
+    permissions:
+      contents: read
     uses: yiisoft/actions/.github/workflows/rector.yml@master
     secrets:
       token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
EOF
@@ -13,6 +13,8 @@

jobs:
rector:
permissions:
contents: read
uses: yiisoft/actions/.github/workflows/rector.yml@master
secrets:
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
Copilot is powered by AI and may make mistakes. Always verify output.
@vjik vjik requested a review from a team September 23, 2025 12:23
@vjik vjik added the status:code review The pull request needs review. label Sep 23, 2025
@vjik vjik mentioned this pull request Sep 23, 2025
@vjik vjik merged commit 35a1e08 into master Sep 23, 2025
18 of 20 checks passed
@vjik vjik deleted the rector branch September 23, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants