Sync Data to Shared Repository #71
Workflow file for this run
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: Sync Data to Shared Repository | |
| on: | |
| schedule: | |
| - cron: "0 17 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| sync-data: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout team training repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Verify collected_results.csv exists | |
| run: | | |
| if [ ! -f "data/collected_results.csv" ]; then | |
| echo "No collected_results.csv found. Exiting." | |
| exit 1 | |
| fi | |
| echo "Found data/collected_results.csv" | |
| - name: Clone the shared dataset fork | |
| run: | | |
| git clone "https://github.com/Ashour777/BCS2720-project-data-collection-2025-2026.git" shared_repo | |
| cd shared_repo | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git checkout main | |
| - name: Copy updated results to Group 6 | |
| run: | | |
| cp "data/collected_results.csv" "shared_repo/Group 6/combined_results.csv" | |
| echo "Copied collected_results.csv to Group 6 folder as combined_results.csv." | |
| - name: Commit and push updated results to fork | |
| run: | | |
| cd shared_repo | |
| git add "Group 6/combined_results.csv" | |
| git commit -m "Auto-update: Group 6 combined_results.csv" || echo "No changes to commit" | |
| git pull --rebase origin main || echo "No remote changes" | |
| git push https://x-access-token:${{ secrets.UPSTREAM_PAT }}@github.com/Ashour777/BCS2720-project-data-collection-2025-2026.git main |