Sync Update #2968
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 Update | |
| on: | |
| schedule: | |
| - cron: "*/10 * * * *" | |
| workflow_dispatch: | |
| jobs: | |
| check-updates: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout GameTracking-CS2 | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: SteamDatabase/GameTracking-CS2 | |
| path: GameTracking-CS2 | |
| - name: Checkout SwiftlyS2 | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: swiftly-solution/swiftlys2 | |
| path: swiftlys2 | |
| - name: Install Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.13' | |
| - name: Install dependencies | |
| run: pip install proto_schema_parser tqdm wordninja | |
| - name: Sync Protobufs | |
| run: | | |
| mkdir -p swiftlys2/protobufs/cs2 | |
| for file in $(find swiftlys2/protobufs/cs2 -name "*.proto"); do | |
| filename=$(basename "$file") | |
| found_file=$(find GameTracking-CS2/Protobufs -name "$filename" | head -n 1) | |
| if [ -n "$found_file" ]; then | |
| cp "$found_file" "swiftlys2/protobufs/cs2/$filename" | |
| echo "Copied $filename" | |
| else | |
| echo "File $filename not found in GameTracking-CS2" | |
| fi | |
| done | |
| - name: Run Protobuf Generator | |
| run: cd swiftlys2/generator/protobuf_generator && python generate.py | |
| # - name: Run Game Events Generator | |
| # run: cd swiftlys2/generator/gameevent_generator && python generate.py | |
| - name: Check for changes | |
| id: git-check | |
| working-directory: swiftlys2 | |
| run: | | |
| if git diff --quiet; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create Pull Request | |
| if: steps.git-check.outputs.changed == 'true' | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.GIT_PAT }} | |
| commit-message: "Syncing changes automatically to SwiftlyS2 for today's CS2 Update." | |
| branch: update/cs2-sync | |
| delete-branch: true | |
| author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> | |
| title: "[CS2] Sync Update" | |
| body: This PR syncs the changes for the latest CS2 update. Please review the changes and merge if everything looks good. | |
| labels: update, automation | |
| draft: false | |
| path: swiftlys2 |