Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
renxida committed Apr 30, 2024
1 parent 49d6466 commit af009c5
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions .github/workflows/bump_submodules.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,52 @@
# Automatically bumps the torch-mlir submodule to the latest commit on the main branch.
# Runs on a schedule (Sunday and Thursday at 00:00) or can be manually triggered.

name: Bump Submodule

on:
schedule:
- cron: '0 0 * * 0,4' # Run at 00:00 on Sunday and Thursday
pull_request:
branches: ["main"]
paths:
- ".github/workflows/bump_submodules.yml"
# TODO: Uncomment the following lines to enable the schedule when this action is stable & useful enough
# schedule:
# - cron: '0 0 * * 0,4' # Run at 00:00 on Sunday and Thursday

Check failure on line 9 in .github/workflows/bump_submodules.yml

View workflow job for this annotation

GitHub Actions / yamllint

9:67 [trailing-spaces] trailing spaces
workflow_dispatch:

jobs:
bump_submodule:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Checkout repository

Check failure on line 17 in .github/workflows/bump_submodules.yml

View workflow job for this annotation

GitHub Actions / yamllint

17:5 [indentation] wrong indentation: expected 6 but found 4
uses: actions/checkout@v2
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
submodules: true

- name: Bump torch-mlir submodule
id: bump_submodule
run: |
cd third_party/torch-mlir
git fetch origin
git checkout origin/main
torch_mlir_commit=$(git rev-parse HEAD)
TORCH_MLIR_COMMIT=$(git rev-parse HEAD)
cd ../..
git add third_party/torch-mlir
git commit -m "Bump torch-mlir submodule to latest version"
git push
echo "torch_mlir_commit=$torch_mlir_commit" >> $GITHUB_OUTPUT
git commit -m "Bump torch-mlir submodule to $TORCH_MLIR_COMMIT"

Check failure on line 32 in .github/workflows/bump_submodules.yml

View workflow job for this annotation

GitHub Actions / yamllint

32:1 [trailing-spaces] trailing spaces
- name: Setting git config
run: |
git config --local user.email "[email protected]"
git config --local user.name "Submodule Bump Action"

Check failure on line 37 in .github/workflows/bump_submodules.yml

View workflow job for this annotation

GitHub Actions / yamllint

37:1 [trailing-spaces] trailing spaces
- name: Push changes
run: git push

Check failure on line 40 in .github/workflows/bump_submodules.yml

View workflow job for this annotation

GitHub Actions / yamllint

40:1 [trailing-spaces] trailing spaces
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: bump-torch-mlir-submodule
title: 'Bump torch-mlir submodule to latest version'
branch: bump-torch-mlir-submodule-${{ github.run_id }}
title: 'Bump torch-mlir submodule to ${{ steps.bump_submodule.outputs.TORCH_MLIR_COMMIT }}'
body: |
This PR updates the torch-mlir submodule to the latest version available.
Bumped to commit: https://github.com/shark-infra/torch-mlir/commit/${{ steps.bump_submodule.outputs.torch_mlir_commit }}
This PR updates the torch-mlir submodule to commit ${{ steps.bump_submodule.outputs.TORCH_MLIR_COMMIT }}.

Check failure on line 49 in .github/workflows/bump_submodules.yml

View workflow job for this annotation

GitHub Actions / yamllint

49:1 [trailing-spaces] trailing spaces
Auto-generated by GitHub Actions.
commit-message: 'Bump torch-mlir submodule to latest version'
labels: automated-pr
commit-message: 'Bump torch-mlir submodule to ${{ steps.bump_submodule.outputs.TORCH_MLIR_COMMIT }}'
labels: automated-pr

Check failure on line 52 in .github/workflows/bump_submodules.yml

View workflow job for this annotation

GitHub Actions / yamllint

52:29 [new-line-at-end-of-file] no new line character at the end of file

0 comments on commit af009c5

Please sign in to comment.