Commit b9267878 authored by Ted Themistokleous's avatar Ted Themistokleous
Browse files

Update github action for onnxruntime sync to open autoPR

Add better handling of sync action and set this to weekly cron while also
opening up PR.

Adds PR labels and reviewrs for sync action
parent d83b8397
name: Onnxruntime main weekly sync
on:
schedule:
- cron: "05 17 * * 1"
- cron: '50 10 * * 3'
jobs:
runs-on: ubuntu-latest
sync:
createPullRequest:
name: Update and create pull request
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
with:
ref: develop
path: ../
- name: cleanup-old-runs
run: rm -rf onnxruntime
get_date:
steps:
- run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: get_date
run: echo todays_date="$(date +'%Y-%m-%d')" >> $GITHUB_ENV
update_file:
needs: [sync get_date]
steps:
- run: git clone https://github.com/microsoft/onnxruntime.git && cd onnxruntime && git rev-parse HEAD >> ../test/onnx/.onnxrt-commit
- name: get-onnxrt-main
run: git clone https://github.com/microsoft/onnxruntime.git
- name: extract_sha1
run: cd onnxruntime && echo onnxsha="$(git rev-parse HEAD)" >> $GITHUB_ENV
Add_commit:
needs: update_file
steps:
- name: Add & Commit
uses: EndBug/add-and-commit@v9.1.1
with:
new_branch: onnxruntime-sync-${{ steps.date.outputs.date }}
add: ../test/onnx/.onnxrt-commit
message: Update Onnxruntime commit to latest release
default_author: github_actions
push: true
PR:
needs: Add_commit
steps:
- name: GitHub Action for creating Pull Requests
uses: devops-infra/action-pull-request@v0.5.3
- name: echo_sha1
run: echo ${{ env.onnxsha }}
- name: cleanup-run
run: rm -rf onnxruntime
- uses: actions/checkout@v3
with:
ref: master
- name: update_file
run: echo ${{ env.onnxsha }} > test/onnx/.onnxrt-commit
- name: Make changes to pull request
uses: peter-evans/create-pull-request@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
title: Sync Onnxruntime main
reviewer: pfultz2, causten
assignee: TedThemistokleous
label: automatic, onnxruntime
target_branch: develop
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update onnxruntime main ${{ env.onnxsha }}
committer: Github <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: onnxruntime-sync-${{ env.todays_date }}
delete-branch: true
title: 'Onnxruntime Weekly Sync ${{ env.todays_date }}'
body: |
Update CI point for Onnxruntime builds
- Updated with changes from ${{ env.todays_date }}
- Auto-generated by [create-pull-request][1]
- Update .onnxrt-commit to ${{ env.onnxsha }}
[1]: https://github.com/peter-evans/create-pull-request
labels: |
onnxruntime
dependancies
automated
assignees: TedThemistokleous
reviewers: TedThemistokleous causten
draft: false
base: master
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment