Update Dell Driver Pack Catalog #306
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Dell Driver Pack Catalog | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| permissions: | |
| contents: write | |
| jobs: | |
| update: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: main | |
| - name: Download and extract Dell DriverPackCatalog | |
| shell: pwsh | |
| run: | | |
| $cabPath = "$env:TEMP\DriverPackCatalog.cab" | |
| $xmlPath = "$env:TEMP\DriverPackCatalog.xml" | |
| Write-Host "Downloading Dell DriverPackCatalog.cab..." | |
| Invoke-WebRequest -Uri 'https://downloads.dell.com/catalog/DriverPackCatalog.cab' -OutFile $cabPath -UseBasicParsing | |
| Write-Host "Downloaded: $((Get-Item $cabPath).Length) bytes" | |
| Write-Host "Extracting CAB..." | |
| & expand.exe $cabPath $xmlPath | |
| Write-Host "Extracted: $((Get-Item $xmlPath).Length) bytes" | |
| Copy-Item $xmlPath 'OSDCloud\core\driverpacks\dell.xml' -Force | |
| Write-Host "Replaced OSDCloud\core\driverpacks\dell.xml" | |
| [xml]$xml = Get-Content 'OSDCloud\core\driverpacks\dell.xml' -Raw | |
| $version = $xml.DocumentElement.GetAttribute('version') | |
| Write-Host "Dell catalog version: $version" | |
| - name: Commit if changed | |
| shell: pwsh | |
| run: | | |
| git config user.name 'github-actions[bot]' | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add OSDCloud/core/driverpacks/dell.xml | |
| if (git diff --cached --quiet) { | |
| Write-Host "No changes to commit." | |
| } else { | |
| [xml]$xml = Get-Content 'OSDCloud\core\driverpacks\dell.xml' -Raw | |
| $version = $xml.DocumentElement.GetAttribute('version') | |
| git commit -m "chore(catalog): update Dell driver pack catalog ($version)" | |
| git push | |
| } |