From 8f86c913b19f4e885b49d003deb0b61f2c50e3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Hin=C3=BCber?= <105521415+larshinueber@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:46:12 +0200 Subject: [PATCH] github action to sync tudat-space submodule --- .github/sync.yml | 4 ---- .github/workflows/sync-tudat-space.yml | 31 ++++++++++++++++++++++++++ .github/workflows/sync.yml | 22 ------------------ 3 files changed, 31 insertions(+), 26 deletions(-) delete mode 100644 .github/sync.yml create mode 100644 .github/workflows/sync-tudat-space.yml delete mode 100644 .github/workflows/sync.yml diff --git a/.github/sync.yml b/.github/sync.yml deleted file mode 100644 index 29b64b2..0000000 --- a/.github/sync.yml +++ /dev/null @@ -1,4 +0,0 @@ -tudat-team/tudat-space: - - source: estimation/ - dest: docs/source/_src_getting_started/_src_examples/notebooks/estimation/ - deleteOrphaned: true diff --git a/.github/workflows/sync-tudat-space.yml b/.github/workflows/sync-tudat-space.yml new file mode 100644 index 0000000..4359ff0 --- /dev/null +++ b/.github/workflows/sync-tudat-space.yml @@ -0,0 +1,31 @@ +name: Sync tudat-space submodule +on: + push: + branches: + - master + workflow_dispatch: + +env: + TARGET_OWNER: tudat-team + TARGET_REPO: tudat-space + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout target repository + uses: actions/checkout@v4 + with: + repository: ${{ env.TARGET_OWNER }}/${{ env.TARGET_REPO }} + token: ${{ secrets.GH_PAT }} + ref: develop + + - name: Update submodule commit + run: | + git submodule update --init --recursive + git submodule update --recursive --remote + + - name: Commit and push changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Update submodule to ${{ github.event.after }}" \ No newline at end of file diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml deleted file mode 100644 index 8413661..0000000 --- a/.github/workflows/sync.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Sync Files on Merge -on: - pull_request: - branches: - - master - types: [closed] - workflow_dispatch: -jobs: - sync: - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@master - - name: Run GitHub File Sync - uses: BetaHuhn/repo-file-sync-action@v1 - with: - GH_PAT: ${{ secrets.GH_PAT }} - PR_BODY: Please manually remove all non *.ipynp-files. - COMMIT_BODY: "Auto-update tudat-space examples" - REVIEWERS: DominicDirkx -