no message #451
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | name: Push changes to subtree | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up SSH | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
| chmod 600 ~/.ssh/id_rsa | |
| ssh-keyscan github.com >> ~/.ssh/known_hosts | |
| - name: Check out code | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Set Git identity | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "BFMC - Rares Lemnariu" | |
| - name: Check commit message | |
| id: commit_message | |
| run: | | |
| commit_message=$(git log -1 --pretty=%B) | |
| echo "Commit message: $commit_message" | |
| if [[ "$commit_message" == *"Traceback: FromPull"* ]]; then | |
| echo "Commit message contains 'Traceback: FromPull'. Exiting." | |
| # exit 0 | |
| else | |
| # Add the commands you want to execute if the commit message does not contain "Traceback: FromPull" | |
| echo "Commit message does not contain 'Traceback: FromPull'. Proceeding with the rest of the script." | |
| # Your commands go here | |
| fi | |
| - name: Fetch changes from remote | |
| run: | | |
| git remote add shared [email protected]:ECC-BFMC/Shared.git | |
| git fetch shared data | |
| git merge -s ours FETCH_HEAD | |
| - name: Add source to the commit. | |
| run: | | |
| git add src/data | |
| git commit --amend -m "Traceback: project_name=Brain" | |
| - name: Push merged changes to remote data branch | |
| run: | | |
| git subtree push --prefix=src/data shared data | |