From b9a761b9b8834913416e9f6ffbfc742f9b0d7583 Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Thu, 3 Feb 2022 11:23:45 +0800 Subject: [PATCH] added github action to synchronize submodule commits automatically (#193) --- .github/workflows/submodule.yml | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/submodule.yml diff --git a/.github/workflows/submodule.yml b/.github/workflows/submodule.yml new file mode 100644 index 000000000..d19892c39 --- /dev/null +++ b/.github/workflows/submodule.yml @@ -0,0 +1,44 @@ +name: Synchronize Submodule +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + +jobs: + sync-submodule: + runs-on: ubuntu-latest + if: github.repository == 'hpcaitech/ColossalAI' + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + + - name: echo + run: | + echo ${{github}} + + - name: Git Sumbodule Update + run: | + git pull --recurse-submodules + git submodule update --remote --recursive + + - name: Commit update + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + git commit -am "Automated submodule synchronization" + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + title: '[Bot] Synchronize Submodule References' + body: | + Automated PR to update submodule commits + committer: GitHub + author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> + assignees: ${{ github.actor }} + delete-branch: true + branch: create-pull-request/patch-sync-submodule + \ No newline at end of file