-
Notifications
You must be signed in to change notification settings - Fork 3
fix: CI Update. #15
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
fix: CI Update. #15
Conversation
Signed-off-by: Mateusz Chrominski <mateusz.chrominski@intel.com>
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 updates the CI/CD workflow configuration by consolidating pull request workflows and removing redundant secret configurations. The changes streamline the workflow files by removing unnecessary GH_TOKEN secret passing and consolidating two separate pull request workflow files into one.
Key changes:
- Removed redundant GH_TOKEN secret passing from workflows that call reusable workflows
- Consolidated
.github/workflows/pull_requests.ymlinto.github/workflows/pull_request.ymlwith simplified configuration - Cleaned up workflow parameters by removing unnecessary REPOSITORY_NAME and BRANCH_NAME from run_tests workflow
Reviewed changes
Copilot reviewed 4 out of 9 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/run_tests.yml | Removed GH_TOKEN secret and repository/branch parameters |
| .github/workflows/pull_requests.yml | Deleted old pull request workflow file |
| .github/workflows/pull_request.yml | Added new consolidated pull request workflow with simplified configuration |
| .github/workflows/check_code_standard.yml | Removed GH_TOKEN secret passing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| jobs: | ||
| dependency_review: | ||
| uses: intel/mfd/.github/workflows/dependency_review.yml@main | ||
| uses: intel/mfd/.github/workflows/dependency_review.yml@main |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To fix this issue, you should add an explicit permissions block in .github/workflows/dependency_review.yml to restrict the permissions granted to the GITHUB_TOKEN for this workflow/job. Since this is a dependency review workflow, typically it only requires contents: read permission to check code dependencies—write access is not required. The permissions block can be set at the top (workflow root), which will apply to all jobs, or under the dependency_review job itself. Since there is only a single job, adding it at the workflow root is simple, clear, and effective. This involves inserting the following lines near the top of the file, after the name: line:
permissions:
contents: readNo imports, method or variable changes are needed—just a YAML field addition.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: Dependency Review | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: |
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python_version: ['3.10', '3.13'] | ||
| uses: intel/mfd/.github/workflows/pull_request.yml@main | ||
| secrets: | ||
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
| with: | ||
| REPOSITORY_NAME: ${{ github.event.pull_request.head.repo.full_name }} | ||
| BRANCH_NAME: ${{ github.head_ref }} | ||
| PYTHON_VERSION: ${{ matrix.python_version }} | ||
| PROJECT_NAME: 'mfd-hyperv' No newline at end of file |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
The best practice is to add an explicit permissions block at the top level of the workflow or at the job level for build_whl, specifying the minimal set of permissions required. Given that this workflow likely only needs to check out code and interact with pull requests, a minimal configuration would be contents: read (so it can read code/content) and (optionally) pull-requests: write if the triggered/used workflow needs to update pull request status. If you are unsure but want to err on the side of caution, start with contents: read only. To implement the fix, add a permissions: block near the top of the file (after name: Dev Build and before on:) for workflow-wide minimal privilege, or at the level of the build_whl job if scoping to only that job is preferred. In general, top-level is preferred so all jobs default to minimal permissions.
- File to change:
.github/workflows/pull_request.yml - Add the following lines right after line 1 (after the
name:key):
permissions:
contents: read- Optionally add further permissions if needed for this workflow.
- No additional methods, imports, or definitions are required.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: Dev Build | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: |
|
We don't publish DEVs .whl. |
No description provided.