Skip to content

Commit

Permalink
CI: Introduce workflow to auto-merge RollPyTorch updates (llvm#2196)
Browse files Browse the repository at this point in the history
This patch adds a new workflow that runs when an update to the
rollpytorch branch by silvasean (in whose name the RollPyTorch action
runs) causes the regular CI build to complete without errors.  Upon
execution, this workflow currently just prints the PR number(s) of the
PR created by the RollPyTorch action, but once this is working as
expected, we will add the step to merge the PR changes.
  • Loading branch information
ashay authored Jun 5, 2023
1 parent 75bc6cb commit c804dac
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/RollPyTorch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
uses: peter-evans/create-pull-request@v5.0.1
with:
author: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
branch: rollpytorch/${{ env.PT_RELEASE }}
branch: rollpytorch
body: |
torch version: ${{ env.PT_RELEASE }}
torch commit hash: ${{ env.PT_HASH }}
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/merge-rollpytorch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: RollPyTorch Merge

on:
workflow_run:
workflows: [Build and Test]
types: [completed]
branches: [rollpytorch]

jobs:
merge-pr:
runs-on: ubuntu-latest
if: |
github.repository == 'llvm/torch-mlir' &&
github.event.workflow_run.actor.login == 'silvasean' &&
github.event.workflow_run.conclusion == 'success'
env:
PR_IDS: ${{ toJson(github.event.workflow_run.pull_requests.*.number) }}

steps:
- run: echo "PRs to approve and merge: ${PR_IDS}"

0 comments on commit c804dac

Please sign in to comment.