Skip to content

Update Vulkan SDK Versions #370

Update Vulkan SDK Versions

Update Vulkan SDK Versions #370

Workflow file for this run

name: Update Vulkan SDK Versions
on:
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC
workflow_dispatch: # Allow manual triggering
jobs:
update-versions:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run version update script
run: python3 tools/update_versions.py
- name: Check for changes
id: changes
run: |
if git diff --quiet vulkan/private/versions.json; then
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "No changes detected in versions.json"
else
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "Changes detected in versions.json"
fi
- name: Create Pull Request
if: steps.changes.outputs.has_changes == 'true'
run: |
# Get diff for PR body and branch name
DIFF=$(git diff vulkan/private/versions.json)
HASH=$(echo "$DIFF" | sha256sum | cut -c1-8)
BRANCH_NAME="update-vulkan-${HASH}"
# Do not create PRs with the same contents.
if git ls-remote --exit-code --heads origin "$BRANCH_NAME" >/dev/null 2>&1; then
echo "Branch $BRANCH_NAME already exists. Skipping PR creation."
exit 0
fi
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git checkout -b "$BRANCH_NAME"
git add vulkan/private/versions.json
git commit -m "Update Vulkan SDK versions"
git push origin "$BRANCH_NAME"
gh pr create \
--title "Update Vulkan SDK versions" \
--label "sdk" \
--body "$(cat <<EOF
Updated available Vulkan SDK versions from LunarG website.
## Changes
\`\`\`diff
${DIFF}
\`\`\`
EOF
)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}