Check AOSP Updates #3
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: Check AOSP Updates | |
| on: | |
| schedule: | |
| - cron: '0 9 * * 1' # Every Monday at 9:00 UTC | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| check-updates: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25.x' | |
| - name: Regenerate version tables from AOSP tags | |
| run: make genversions | |
| - name: Regenerate code | |
| run: | | |
| make clean | |
| make generate | |
| make genaidlcli | |
| make smoke | |
| make readme | |
| - name: Check for changes | |
| id: changes | |
| run: | | |
| UNTRACKED=$(git ls-files --others --exclude-standard) | |
| if git diff --quiet && [ -z "$UNTRACKED" ]; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create or update pull request | |
| if: steps.changes.outputs.changed == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| BRANCH="automated/aosp-update" | |
| git checkout -b "$BRANCH" | |
| git add -A | |
| git commit -m "$(cat <<'EOF' | |
| Update AOSP version tables and generated code | |
| Automated weekly check found new AOSP revision tags. | |
| EOF | |
| )" | |
| git push --force -u origin "$BRANCH" | |
| # Create PR only if one doesn't already exist for this branch. | |
| EXISTING_PR=$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number' 2>/dev/null || true) | |
| if [ -n "$EXISTING_PR" ]; then | |
| echo "PR #$EXISTING_PR already exists and has been updated." | |
| else | |
| gh pr create \ | |
| --title "Update AOSP generated code" \ | |
| --body "$(cat <<'EOF' | |
| ## Summary | |
| Automated weekly check detected new AOSP revision tags. This PR updates: | |
| - Version transaction code tables (`binder/versionaware/codes_gen.go`) | |
| - Generated AIDL proxy code | |
| - E2E smoke tests | |
| - README package statistics | |
| ## Test plan | |
| - [ ] CI passes (unit tests, vet, build, check-generated) | |
| - [ ] Review generated diff for unexpected changes | |
| EOF | |
| )" | |
| fi |