SDK Sync #5
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: SDK Sync | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 0' | |
| workflow_dispatch: | |
| inputs: | |
| nrf_repo: | |
| description: 'sdk-nrf repository (owner/name)' | |
| required: false | |
| default: 'ArekBalysNordic/sdk-nrf' | |
| chip_repo: | |
| description: 'sdk-connectedhomeip repository (owner/name)' | |
| required: false | |
| default: 'ArekBalysNordic/sdk-connectedhomeip' | |
| push: | |
| branches: | |
| - sdk-nrf | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| sdk-sync: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| SDK_SYNC_PAT: ${{ secrets.SDK_SYNC_PAT }} | |
| GH_TOKEN: ${{ secrets.SDK_SYNC_PAT }} | |
| SDK_SYNC_NRF_REPO: ${{ inputs.nrf_repo || 'ArekBalysNordic/sdk-nrf' }} | |
| SDK_SYNC_CHIP_REPO: ${{ inputs.chip_repo || 'ArekBalysNordic/sdk-connectedhomeip' }} | |
| steps: | |
| - name: Checkout the code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set state file path | |
| run: echo "STATE_FILE=${RUNNER_TEMP}/sdk_sync_state.json" >> "$GITHUB_ENV" | |
| - name: Set up Python | |
| uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5 | |
| with: | |
| python-version: '3.12' | |
| cache: pip | |
| cache-dependency-path: scripts/sdk_sync/requirements.txt | |
| - name: Install dependencies | |
| run: pip install -r scripts/sdk_sync/requirements.txt | |
| - name: Configure git credentials | |
| run: | | |
| git remote set-url origin "https://x-access-token:${SDK_SYNC_PAT}@github.com/${{ github.repository }}.git" | |
| git config --global user.email "sdk-sync-bot@users.noreply.github.com" | |
| git config --global user.name "sdk-sync-bot" | |
| - name: Prepare test PR branch | |
| run: python scripts/sdk_sync/prepare_pr.py --source-branch main --base-branch sdk-nrf --state-file "${STATE_FILE}" | |
| - name: Collect upstream revision report | |
| run: python scripts/sdk_sync/chip_sync_report.py --state-file "${STATE_FILE}" | |
| - name: Update west.yml on PR branch | |
| run: | | |
| git checkout sdk-sync/test | |
| python scripts/sdk_sync/update_manifest.py --state-file "${STATE_FILE}" --branch sdk-sync/test | |
| - name: Post sync summary comment | |
| run: python scripts/sdk_sync/build_report.py --state-file "${STATE_FILE}" |