Skip to content

Autobump nvidia vers on a schedule #1

Autobump nvidia vers on a schedule

Autobump nvidia vers on a schedule #1

Workflow file for this run

name: Update NVIDIA driver versions
on:
# NVIDIA Unix driver releases are infrequent so a weekly check is plenty.
schedule:
- cron: "0 14 * * 1"
workflow_dispatch:
# TEMPORARY: smoke-test trigger — remove before merging.
pull_request:
paths:
- .github/workflows/refresh-nvidia.yml
- hack/build/refresh-nvidia-versions.py
permissions:
contents: write
pull-requests: write
jobs:
refresh:
name: Open PR if NVIDIA versions changed
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
with:
egress-policy: audit
- name: checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
- name: scrape upstream and rewrite config.yaml
run: python3 ./hack/build/refresh-nvidia-versions.py
- name: open PR if config.yaml changed
env:
# AUTO_PR_TOKEN, if configured as a PAT in repo secrets, lets the auto-PR
# trigger downstream `pull_request` workflows (the kernel build test).
# Without it we fall back to GITHUB_TOKEN, which can create the PR but
# will not allow CI jobs to autotrigger on PR open - a person still needs
# to kick over/close-reopen the PR to trigger CI.
# TODO bml generate and define a standalone token
GH_TOKEN: ${{ secrets.AUTO_PR_TOKEN || secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
if git diff --quiet -- config.yaml; then
echo "no NVIDIA version changes — nothing to do"
exit 0
fi
branch="auto/refresh-nvidia-$(date -u +%Y%m%d)"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b "$branch"
git add config.yaml
git commit -m "chore: bump NVIDIA driver versions from upstream"
git push --set-upstream origin "$branch"
gh pr create \
--base main \
--head "$branch" \
--title "chore: bump NVIDIA driver versions" \
--body "Automated refresh from https://www.nvidia.com/en-us/drivers/unix/. Review the diff in \`config.yaml\` and confirm the bumped image tags build cleanly before merging."