This repository was archived by the owner on Oct 11, 2025. It is now read-only.
add auto integrate GHA #1
Workflow file for this run
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
| # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| # See https://llvm.org/LICENSE.txt for license information. | |
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| # Copyright (c) 2024. | |
| name: Auto Integrate LLVM | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| schedule: | |
| # At minute 0 past hour 1. (see https://crontab.guru) | |
| - cron: '00 01 * * *' | |
| jobs: | |
| update-dep: | |
| name: "Integrate LLVM and send PR" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: "Check out repository" | |
| uses: actions/checkout@v4.2.2 | |
| - name: "Get filtered llvm-project" | |
| id: get-llvm-project | |
| run: | | |
| pushd /tmp | |
| git clone https://github.com/llvm/llvm-project.git | |
| pushd /llvm-project | |
| echo "LLVM_SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| git filter-repo --subdirectory-filter mlir/lib/Bindings/Python | |
| popd | |
| popd | |
| - name: "Rebase on top of llvm-project" | |
| id: rebase-llvm-project | |
| run: | | |
| git pull /tmp/llvm-project main --rebase | |
| - name: Generate token | |
| uses: actions/create-github-app-token@v1 | |
| id: generate-token | |
| with: | |
| app-id: ${{ secrets.BUMP_LLVM_CREATE_PR_APP_ID }} | |
| private-key: ${{ secrets.BUMP_LLVM_CREATE_PR_APP_PRIVATE_KEY }} | |
| - name: "Create Pull Request" | |
| id: cpr | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ steps.generate-token.outputs.token }} | |
| commit-message: "[LLVM] Integrate to ${{ steps.get-llvm-project.outputs.LLVM_SHA_SHORT }}" | |
| title: "[LLVM] Integrate to ${{ steps.get-llvm-project.outputs.LLVM_SHA_SHORT }}" | |
| body: "Integrate LLVM to https://github.com/llvm/llvm-project/commit/${{ steps.get-llvm-project.outputs.LLVM_SHA_SHORT }}" | |
| author: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>' | |
| base: main | |
| branch: update-llvm | |
| delete-branch: true | |
| assignees: makslevental | |
| reviewers: makslevental | |
| - name: Enable auto-merge | |
| uses: peter-evans/enable-pull-request-automerge@v3 | |
| with: | |
| token: ${{ steps.generate-token.outputs.token }} | |
| pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
| merge-method: squash | |
| - name: Auto approve | |
| run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-number }}" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| merge-method: squash |