diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35af2af..8f0ad64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,15 @@ on: branches: - pipeline workflow_dispatch: # This triggers the workflow when a webhook is received + inputs: + branch: + description: 'The branch of the submodule the workflow was triggered for' + required: true + type: string + repository: + description: 'The repository of the submodule the workflow was triggered for' + required: true + type: string jobs: @@ -35,13 +44,18 @@ jobs: - name: Push to main run: | - cp -R target/* main - cd main - git config --global user.email "openminds@ebrains.eu" + rsync -a --delete --exclude '.git/' --exclude 'img/' --exclude 'README.md' target/ main/ + cp LICENSE main/ + cd main + git config --global user.email "support@openmetadatainitiative.org" git config --global user.name "openMINDS pipeline" - if [[ $(git add . --dry-run | wc -l) -gt 0 ]]; then - git add . - git commit -m "build triggered by submodule ${{ inputs.repository }} version ${{ inputs.branch }}" + if [[ $(git add -A --dry-run | wc -l) -gt 0 ]]; then + git add -A + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + git commit -m "build triggered by submodule ${{ inputs.repository }} version ${{ inputs.branch }}" + else + git commit -m "build triggered by ${{ github.event_name }}" + fi git push -f else echo "Nothing to commit"