Skip to content

Conversation

ssitar583
Copy link
Contributor

No description provided.

@ssitar583 ssitar583 requested a review from a team as a code owner July 8, 2025 10:27
@CLAassistant
Copy link

CLAassistant commented Jul 8, 2025

CLA assistant check
All committers have signed the CLA.

@ssitar583 ssitar583 linked an issue Jul 8, 2025 that may be closed by this pull request
Comment on lines +11 to +15
runs-on: ubuntu-latest
steps:
- run: echo "Triggered"

call_auto_pr_workflow:

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

To fix the issue, add an explicit permissions block to the workflow. Since the debug_check job only echoes a message, it requires minimal permissions (e.g., contents: read). The call_auto_pr_workflow job involves calling an external workflow and using secrets, which might require additional permissions, such as contents: read and pull-requests: write. These permissions should be set to the least privilege necessary for the tasks.

Suggested changeset 1
.github/workflows/auto_pr_creation_target_repo_caller.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/auto_pr_creation_target_repo_caller.yml b/.github/workflows/auto_pr_creation_target_repo_caller.yml
--- a/.github/workflows/auto_pr_creation_target_repo_caller.yml
+++ b/.github/workflows/auto_pr_creation_target_repo_caller.yml
@@ -6,15 +6,22 @@
     branches:
       - test_develop
 
+permissions:
+  contents: read
+  pull-requests: write
+
 jobs:
   debug_check:
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
     steps:
       - run: echo "Triggered" 
       
   call_auto_pr_workflow:
-    #secrets:
-      #RDKCM_RDKE: ${{ secrets.RDKCM_RDKE }}
+    permissions:
+      contents: read
+      pull-requests: write
     uses: rdkcentral/build_tools_workflows/.github/workflows/auto_pr_creation_meta.yml@RDKEMW-4778
     secrets:
       RDKCM_RDKE: ${{ secrets.RDKCM_RDKE }}
EOF
@@ -6,15 +6,22 @@
branches:
- test_develop

permissions:
contents: read
pull-requests: write

jobs:
debug_check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- run: echo "Triggered"

call_auto_pr_workflow:
#secrets:
#RDKCM_RDKE: ${{ secrets.RDKCM_RDKE }}
permissions:
contents: read
pull-requests: write
uses: rdkcentral/build_tools_workflows/.github/workflows/auto_pr_creation_meta.yml@RDKEMW-4778
secrets:
RDKCM_RDKE: ${{ secrets.RDKCM_RDKE }}
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +18 to +24
uses: rdkcentral/build_tools_workflows/.github/workflows/auto_pr_creation_meta.yml@RDKEMW-4778
secrets:
RDKCM_RDKE: ${{ secrets.RDKCM_RDKE }}
#runs-on: ubuntu-latest
#steps:
# - name: Print placeholder instead of actual logic
# run: echo "This is a placeholder for the actual logic."

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

To fix the issue, we should add a permissions block to explicitly limit the permissions of the GITHUB_TOKEN. The permissions should only allow the minimum necessary access, based on the workflow's functionality. For example:

  • contents: read is typically required for read-only access to the repository’s contents.
  • Additional permissions (like pull-requests: write) can be added if the workflow needs to create or update pull requests.

The permissions block can be added at the workflow level (to apply to all jobs) or at the job level (to be specific to individual jobs). In this case, adding the permissions block at the workflow level ensures all jobs in the workflow inherit these minimal permissions.


Suggested changeset 1
.github/workflows/auto_pr_creation_target_repo_caller.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/auto_pr_creation_target_repo_caller.yml b/.github/workflows/auto_pr_creation_target_repo_caller.yml
--- a/.github/workflows/auto_pr_creation_target_repo_caller.yml
+++ b/.github/workflows/auto_pr_creation_target_repo_caller.yml
@@ -1,5 +1,9 @@
 name: Auto PR Creation Caller
 
+permissions:
+  contents: read
+  pull-requests: write
+
 on:
   pull_request:
     types: [closed]
EOF
@@ -1,5 +1,9 @@
name: Auto PR Creation Caller

permissions:
contents: read
pull-requests: write

on:
pull_request:
types: [closed]
Copilot is powered by AI and may make mistakes. Always verify output.
@ssitar583 ssitar583 marked this pull request as draft July 28, 2025 10:57
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.

RDKEMW-4778: Test
2 participants