Skip to content
60 changes: 60 additions & 0 deletions .github/workflows/auto_pr_creation_rdke_manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Update Manifests on Sub-manifest Repo Merge

on:
workflow_call:
secrets:
RDKCM_RDKE:
required: true

jobs:
auto_pr_creation_rdke_manifest:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Checkout build_tools_workflows code
uses: actions/checkout@v4
with:
repository: rdkcentral/build_tools_workflows
path: 'tools'
ref: develop
token: ${{ secrets.RDKCM_RDKE }}

- name: Checkout Manifest Repository
uses: actions/checkout@v4
with:
repository: 'rdkcentral/middleware-manifest-rdke'
path: 'manifest_repo'
ref: develop
token: ${{ secrets.RDKCM_RDKE }}

- name: Update Git Config
env:
BOT_EMAIL: ${{ vars.RDKM_BOT_EMAIL }}
run: |
cd manifest_repo
git config user.name "bot"
git config user.email "$BOT_EMAIL"
cd ..

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
pip install requests PyGithub GitPython

- name: Run the update script
env:
GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }}
GITHUB_ORG: 'rdkcentral'
MANIFEST_REPO_PATH: ${{ github.workspace }}/manifest_repo
MANIFEST_REPO_NAME: 'rdkcentral/middleware-manifest-rdke'
PR_NUMBER: ${{ github.event.pull_request.number }}
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
run: |
cd manifest_repo
python3 ../tools/build_health_check_workflow_scripts/auto_pr_generation_manifest.py
cd ..
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,25 @@ def update_xml_files(manifest_repo_path, updates):

for xml_file in xml_files:
xml_path = os.path.join(manifest_repo_path, xml_file)
print("Checking {}".format(xml_file))
tree = ET.parse(xml_path)
root = tree.getroot()
file_changed = False

for project in root.findall('project'):
print("Checking projects {}".format(project.get('name')))
if project.get('name') in updates and project.get('revision') != updates[project.get('name')]:
print("Updating {}: {} from {} to {}".format(xml_file, project.get('name'), project.get('revision'), updates[project.get('name')]))
project.set('revision', updates[project.get('name')])
file_changed = True

for submanifest in root.findall('submanifest'):
print("Checking submanifests {}".format(submanifest.get('project')))
if submanifest.get('project') in updates and submanifest.get('revision') != updates[submanifest.get('project')]:
print("Updating {}: {} from {} to {}".format(xml_file, submanifest.get('project'), submanifest.get('revision'), updates[submanifest.get('project')]))
Comment on lines +162 to +164
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logging format for submanifests uses 'project' attribute while the logging for projects uses 'name' attribute. For consistency, consider using the same attribute name or making it clear in the log message which attribute is being displayed. The submanifest element's primary identifier appears to be 'project', so the logging is accurate, but it differs from the pattern used for projects.

Suggested change
print("Checking submanifests {}".format(submanifest.get('project')))
if submanifest.get('project') in updates and submanifest.get('revision') != updates[submanifest.get('project')]:
print("Updating {}: {} from {} to {}".format(xml_file, submanifest.get('project'), submanifest.get('revision'), updates[submanifest.get('project')]))
print("Checking submanifests (project={})".format(submanifest.get('project')))
if submanifest.get('project') in updates and submanifest.get('revision') != updates[submanifest.get('project')]:
print("Updating {}: submanifest project {} from {} to {}".format(xml_file, submanifest.get('project'), submanifest.get('revision'), updates[submanifest.get('project')]))

Copilot uses AI. Check for mistakes.
submanifest.set('revision', updates[submanifest.get('project')])
file_changed = True

if file_changed:
write_xml(root, xml_path)
print("Updated {}".format(xml_file))
Expand Down
Loading