Repository navigation
Conversation
Signed-off-by: Mateusz Chrominski <mateusz.chrominski@intel.com>
There was a problem hiding this comment.
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 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 11 months 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.
| @@ -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 11 months 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.
| @@ -1,4 +1,6 @@ | ||
| name: Dev Build | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: |
|
We don't publish DEVs .whl. |
No description provided.