-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to auto create uplift PR (#935)
Add workflow to auto create uplift PR
- Loading branch information
1 parent
504e352
commit ede24ed
Showing
2 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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,64 @@ | ||
# This workflow automates creation of uplift pull requests. | ||
# Uplift PR is created daily to uplift the submodule to the latest version. | ||
|
||
name: Nighty Uplift | ||
|
||
on: | ||
schedule: | ||
- cron: '0 8 * * *' # Runs at 08:00 UTC every day | ||
workflow_dispatch: # Manual trigger | ||
|
||
jobs: | ||
uplift-pr: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
SUBMODULE_PATH: third_party/tt-metal | ||
TT_METAL_VERSION: origin/main | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Set env variable | ||
run: | | ||
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
- name: Update tt-metal reference | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
# Fetch the latest SHA using GitHub CLI | ||
LATEST_SHA=$(gh api repos/tenstorrent/tt-metal/commits/main --jq '.sha') | ||
# Update the third_party/CMakeLists.txt file with the new SHA | ||
sed -i "s/set(TT_METAL_VERSION \".*\")/set(TT_METAL_VERSION \"${LATEST_SHA}\")/" third_party/CMakeLists.txt | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v7 | ||
id: create-pr | ||
with: | ||
branch: uplift | ||
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | ||
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> | ||
base: main | ||
commit-message: "Uplift ${{ env.SUBMODULE_PATH }} to ${{ env.SUBMODULE_VERSION }} ${{ env.TODAY }}" | ||
title: "Uplift ${{ env.SUBMODULE_PATH }} to ${{ env.SUBMODULE_VERSION }} ${{ env.TODAY }}" | ||
body: "This PR uplifts the ${{ env.SUBMODULE_PATH }} to the ${{ env.SUBMODULE_VERSION }}" | ||
labels: uplift | ||
delete-branch: true | ||
token: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Approve Pull Request | ||
if: ${{ steps.create-pr.outputs.pull-request-number }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_APPROVE_TOKEN }} | ||
run: | | ||
echo "Pull Request Number - ${{ steps.create-pr.outputs.pull-request-number }}" | ||
echo "Pull Request URL - ${{ steps.create-pr.outputs.pull-request-url }}" | ||
gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve | ||
- name: Enable Pull Request Automerge | ||
if: ${{ steps.create-pr.outputs.pull-request-number }} | ||
run: gh pr merge --squash --auto "${{ steps.create-pr.outputs.pull-request-number }}" | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} |
This file contains 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