From 3e19ad30ffd285fb75ac07f8390faf0eabe8fb49 Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Tue, 20 Apr 2021 16:52:10 +1000 Subject: [PATCH] Auto update protobuf submodule action --- .github/workflows/update_protobufs.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/update_protobufs.yml diff --git a/.github/workflows/update_protobufs.yml b/.github/workflows/update_protobufs.yml new file mode 100644 index 00000000..9715abcd --- /dev/null +++ b/.github/workflows/update_protobufs.yml @@ -0,0 +1,26 @@ +name: "Update protobufs" +on: workflow_dispatch + +jobs: + update-protobufs: + environment: Production + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + token: ${{ secrets.ACCESS_TOKEN }} + submodules: true + + - name: Update Submodule + 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 'bot@noreply.github.com' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + git commit -am "Update protobuf submodule" && git push || echo "No changes to commit"