torch-mlir/.github/workflows/merge-rollpytorch.yml

35 lines
968 B
YAML
Raw Normal View History

# yamllint disable rule:line-length
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 == 'stellaraccident' &&
github.event.workflow_run.conclusion == 'success'
steps:
# Fetch the repo first so that the gh command knows where to look for the PR
- name: Fetch Repo
uses: actions/checkout@v3
with:
token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
- name: Merge RollPyTorch PR
run: |
for pr_id in ${{ join(github.event.workflow_run.pull_requests.*.number, ' ') }}
do
echo "Merging PR: $pr_id"
gh pr merge $pr_id --delete-branch --squash
done
shell: bash
env:
GH_TOKEN: ${{ secrets.ROLLPYTORCH_TOKEN1 }}