Skip to content
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/bump_rocm_libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Bump rocm-libraries submodule

on:
workflow_dispatch:
schedule:
- cron: "0 11 * * *"
permissions:
contents: write
pull-requests: write
jobs:
bump-submodules:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.12'
- name: Configure Git Identity
run: |
git config --global user.name "therockbot"
git config --global user.email "[email protected]"
- name: Set branch name
id: set-branch
run: |
DATE=$(date +%Y%m%d)
BRANCH="github-action/bump-rocm-libraries-submodule-$DATE"
echo "branch-name=$BRANCH" >> $GITHUB_OUTPUT
- name: Run bump_submodules.py
run: |
CMD="python3 ./build_tools/bump_submodules.py --push-branch --branch-name ${{ steps.set-branch.outputs.branch-name }} --components rocm-libraries"
echo "Running command: $CMD"
eval $CMD
- name: Prepare PR body with diff info
run: |
echo "Automated daily submodule bump" > pr_body.txt
echo "This PR was automatically created by a GitHub App to update submodules." >> pr_body.txt
echo "" >> pr_body.txt
git fetch origin main
echo "## Submodule changes" >> pr_body.txt
echo "" >> pr_body.txt
git diff origin/main ${{ steps.set-branch.outputs.branch-name }} | \
grep -E '^diff --git |^\+\+\+|^---|^\+Subproject commit|^-Subproject commit' | \
sed \
-e 's/^diff --git/### diff --git/g' \
-e 's/^---/Old path:/g' \
-e 's/^\+\+\+/New path:/g' \
-e 's/^-Subproject commit/ Old commit:/g' \
-e 's/^\+Subproject commit/ New commit:/g' \
>> pr_body.txt
echo "" >> pr_body.txt
- name: Generate GitHub App token
uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
id: generate-token
with:
app-id: ${{ secrets.PULL_REQUEST_APP_ID }}
private-key: ${{ secrets.PULL_REQUEST_APP_KEY }}
- name: Create pull request
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
DATE=$(date +%Y%m%d)
gh pr create \
--base main \
--head ${{ steps.set-branch.outputs.branch-name }} \
--title "rocm-libraries Submodule Bump-$DATE" \
--body-file pr_body.txt
Loading