Skip to content

Conversation

pmarusz
Copy link
Contributor

@pmarusz pmarusz commented Aug 26, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings August 26, 2025 07:24
Copy link

@Copilot Copilot AI left a 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 migrates the GitHub Actions workflows from local implementations to reusable workflows hosted in the intel/mfd repository. The changes replace inline workflow definitions with calls to centralized workflows, simplifying maintenance and ensuring consistency across projects.

Key changes:

  • Replace local workflow implementations with reusable workflow calls
  • Consolidate workflow triggers and job configurations
  • Add new workflows for dependency review, PR validation, and code standards

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/run_tests.yml New workflow calling reusable test execution workflow
.github/workflows/pull_requests.yml Removed - replaced by pull_request.yml
.github/workflows/pull_request.yml New workflow calling reusable PR build workflow
.github/workflows/manual_release.yml Updated to use reusable release workflow with simplified matrix
.github/workflows/main.yml New workflow calling reusable main branch build workflow
.github/workflows/dependency_review.yml New workflow for dependency security checks
.github/workflows/check_pr_format.yml New workflow for PR title and commit validation
.github/workflows/check_code_standard.yml New workflow for code standard validation
.github/workflows/build_upload_whl.yml Removed - functionality moved to reusable workflows
.github/dependency_review.yml Configuration file for dependency review settings
.github/dependabot.yml Configuration for automated dependency updates

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 9 to 18
strategy:
fail-fast: false
matrix:
python_version: ['3.10', '3.13']
uses: intel/mfd/.github/workflows/check_code_standard.yml@add-common-actions
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
with:
REPOSITORY_NAME: ${{ github.event.pull_request.head.repo.full_name }}
BRANCH_NAME: ${{ github.head_ref }}

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 about 2 months ago

To fix this problem, set the least-privilege permissions for GITHUB_TOKEN by adding a permissions: block. Since the job is performing check-standard tasks on pull_request events, the safest default is contents: read unless more privileges are required. Add the block at the job level (run_check_standard), directly above the strategy: section at line 9. This ensures that the job only uses GITHUB_TOKEN for read access to repo contents and cannot write to the repository, issues, or PRs. No imports or package changes are needed; simply modify the YAML structure.


Suggested changeset 1
.github/workflows/check_code_standard.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/check_code_standard.yml b/.github/workflows/check_code_standard.yml
--- a/.github/workflows/check_code_standard.yml
+++ b/.github/workflows/check_code_standard.yml
@@ -6,6 +6,8 @@
 
 jobs:
   run_check_standard:
+    permissions:
+      contents: read
     strategy:
       fail-fast: false
       matrix:
EOF
@@ -6,6 +6,8 @@

jobs:
run_check_standard:
permissions:
contents: read
strategy:
fail-fast: false
matrix:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines 10 to 21
strategy:
fail-fast: false
matrix:
python_version: ['3.10', '3.13']
uses: intel/mfd/.github/workflows/main.yml@add-common-actions
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
with:
REPOSITORY_NAME: ${{ github.repository }}
BRANCH_NAME: ${{ github.ref_name }}
PYTHON_VERSION: ${{ matrix.python_version }}
PROJECT_NAME: 'mfd-const'

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 about 2 months ago

To fix the problem, add an explicit permissions block to the job or workflow file, setting only the least privileges required. For most build/test jobs (particularly if they only need to checkout code and do not push, open pull requests, or write to repositories), the minimal contents: read permission is sufficient. The best way to fix this is to add permissions: contents: read at the job definition (indentation matched to the job level, i.e., right below the job name and just above strategy). This change should be made directly in .github/workflows/main.yml for the build_whl job. No other lines or files should be touched.


Suggested changeset 1
.github/workflows/main.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/main.yml b/.github/workflows/main.yml
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -7,6 +7,8 @@
 
 jobs:
   build_whl:
+    permissions:
+      contents: read
     strategy:
       fail-fast: false
       matrix:
EOF
@@ -7,6 +7,8 @@

jobs:
build_whl:
permissions:
contents: read
strategy:
fail-fast: false
matrix:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines 9 to 20
strategy:
fail-fast: false
matrix:
python_version: ['3.10', '3.13']
uses: intel/mfd/.github/workflows/pull_request.yml@add-common-actions
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-const'

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 about 2 months ago

To fix the issue, you should explicitly set a permissions block at the workflow or job level to limit the privileges of the GITHUB_TOKEN to only what is strictly necessary. The best practice is to set this at the root of the workflow (top-level), but you can also set it inside the job definition. Given this workflow likely only needs to read contents and possibly write to pull requests (to comment/status, etc.), the minimal fix is:

At the top-level (before jobs:), add:

permissions:
  contents: read
  pull-requests: write

Alternatively, if your workflow does not need to write to pull requests, you can further restrict. The lines should be added right after the workflow name: and on: keys but before jobs:.

Suggested changeset 1
.github/workflows/pull_request.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/pull_request.yml b/.github/workflows/pull_request.yml
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -4,6 +4,9 @@
   pull_request:
     types: [opened, synchronize]
 
+permissions:
+  contents: read
+  pull-requests: write
 jobs:
   build_whl:
     strategy:
EOF
@@ -4,6 +4,9 @@
pull_request:
types: [opened, synchronize]

permissions:
contents: read
pull-requests: write
jobs:
build_whl:
strategy:
Copilot is powered by AI and may make mistakes. Always verify output.
@mfd-intel-bot
Copy link
Contributor

We don't publish DEVs .whl.
To build .whl, run 'pip install git+https://intel/mfd-const@new-workflow'

@pmarusz pmarusz force-pushed the new-workflow branch 2 times, most recently from 4c6a912 to 98f3824 Compare August 26, 2025 07:48
Comment on lines +9 to +12
uses: intel/mfd/.github/workflows/check_pr_format.yml@main
with:
REPOSITORY_NAME: ${{ github.event.pull_request.head.repo.full_name }}
BRANCH_NAME: ${{ github.head_ref }}

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 about 2 months ago

To fix the problem, a permissions block should be explicitly added to the workflow or the relevant job to limit the GitHub token’s permissions. Since the job appears to only validate PR format (not make changes), it likely only needs read access. The most secure approach is to set the permissions at the workflow root, applying to all jobs by default. If the job or called workflow requires specific permissions, these can be set later, but the least privilege is contents: read. The fix only involves adding a permissions block after the workflow’s name line.


Suggested changeset 1
.github/workflows/check_pr_format.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/check_pr_format.yml b/.github/workflows/check_pr_format.yml
--- a/.github/workflows/check_pr_format.yml
+++ b/.github/workflows/check_pr_format.yml
@@ -1,3 +1,5 @@
+permissions:
+  contents: read
 name: Title + Commit Validation
 
 on:
EOF
@@ -1,3 +1,5 @@
permissions:
contents: read
name: Title + Commit Validation

on:
Copilot is powered by AI and may make mistakes. Always verify output.

jobs:
dependency_review:
uses: intel/mfd/.github/workflows/dependency_review.yml@main

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 about 2 months ago

To fix the problem, add a permissions block, either at the workflow root or under the specific job (dependency_review). Since this workflow’s job simply uses another workflow and likely needs only minimal permissions associated with dependency review (primarily contents: read), it’s best to add the most restrictive set possible. Modify .github/workflows/dependency_review.yml to include a permissions block at the root level, granting only the minimal necessary permissions (usually contents: read). This can be inserted after the name: field and before the on: field to apply to the whole workflow (recommended), unless deeper inspection of the reusable workflow indicates the need for additional privileges.

Suggested changeset 1
.github/workflows/dependency_review.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/dependency_review.yml b/.github/workflows/dependency_review.yml
--- a/.github/workflows/dependency_review.yml
+++ b/.github/workflows/dependency_review.yml
@@ -1,3 +1,5 @@
+permissions:
+  contents: read
 name: Dependency Review
 
 on:
EOF
@@ -1,3 +1,5 @@
permissions:
contents: read
name: Dependency Review

on:
Copilot is powered by AI and may make mistakes. Always verify output.
Signed-off-by: Maruszewski, Piotr <piotr.maruszewski@intel.com>
@abaczek abaczek merged commit 1b68875 into main Aug 26, 2025
23 checks passed
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.

4 participants