-
Notifications
You must be signed in to change notification settings - Fork 142
Automation to bump rocm-libraries submodule daily #2401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ammallya
wants to merge
7
commits into
main
Choose a base branch
from
ammallya-patch-3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1a822dc
Automation to bump rocm-libraries submodule daily
ammallya 8e2661a
Fixing pinned commit after github reorg
ammallya a5e3cee
Fix correct token generation
ammallya 9bdb816
Fixing pre-commit
ammallya 25ecb89
Fixing trailing whitespace
ammallya a574083
Moving logic from workflow to python script
ammallya 684853c
Adding a seperate flag to create a PR and modifying commit message
ammallya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| 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 * * *" | ||
ammallya marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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 | ||
ammallya marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - 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 | ||
ammallya marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - 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" \ | ||
ammallya marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --body-file pr_body.txt | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.