|
| 1 | +name: Update Tool Versions |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # Run every Monday at 2 AM UTC |
| 6 | + - cron: '0 2 * * 1' |
| 7 | + workflow_dispatch: # Allow manual trigger |
| 8 | + |
| 9 | +jobs: |
| 10 | + update-versions: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Checkout repository |
| 15 | + uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 18 | + |
| 19 | + - name: Set up Python |
| 20 | + uses: actions/setup-python@v4 |
| 21 | + with: |
| 22 | + python-version: '3.11' |
| 23 | + |
| 24 | + - name: Update versions |
| 25 | + run: | |
| 26 | + python3 scripts/update_versions.py |
| 27 | +
|
| 28 | + - name: Check for changes |
| 29 | + id: verify-changed-files |
| 30 | + run: | |
| 31 | + if [ -n "$(git status --porcelain)" ]; then |
| 32 | + echo "changed=true" >> $GITHUB_OUTPUT |
| 33 | + else |
| 34 | + echo "changed=false" >> $GITHUB_OUTPUT |
| 35 | + fi |
| 36 | +
|
| 37 | + - name: Get latest versions for PR description |
| 38 | + if: steps.verify-changed-files.outputs.changed == 'true' |
| 39 | + id: get-versions |
| 40 | + run: | |
| 41 | + CLANG_FORMAT_VERSION=$(python3 -c 'from cpp_linter_hooks.versions import CLANG_FORMAT_VERSIONS; print(CLANG_FORMAT_VERSIONS[-1])') |
| 42 | + CLANG_TIDY_VERSION=$(python3 -c 'from cpp_linter_hooks.versions import CLANG_TIDY_VERSIONS; print(CLANG_TIDY_VERSIONS[-1])') |
| 43 | + echo "clang_format_version=$CLANG_FORMAT_VERSION" >> $GITHUB_OUTPUT |
| 44 | + echo "clang_tidy_version=$CLANG_TIDY_VERSION" >> $GITHUB_OUTPUT |
| 45 | +
|
| 46 | + - name: Create Pull Request |
| 47 | + if: steps.verify-changed-files.outputs.changed == 'true' |
| 48 | + uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 |
| 49 | + with: |
| 50 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 51 | + commit-message: | |
| 52 | + chore: update clang-format and clang-tidy versions |
| 53 | +
|
| 54 | + - Updated versions automatically from PyPI |
| 55 | + title: "chore: update tool versions to latest" |
| 56 | + body: | |
| 57 | + ## 🔄 Automated Version Update |
| 58 | +
|
| 59 | + This PR updates the hardcoded versions for clang-format and clang-tidy tools to the latest available versions from PyPI. |
| 60 | +
|
| 61 | + ### 📦 Updated Versions |
| 62 | + - **clang-format**: `${{ steps.get-versions.outputs.clang_format_version }}` |
| 63 | + - **clang-tidy**: `${{ steps.get-versions.outputs.clang_tidy_version }}` |
| 64 | +
|
| 65 | + ### 🤖 Automation Details |
| 66 | + - This update was triggered automatically by the scheduled workflow |
| 67 | + - Versions are fetched from the official PyPI APIs |
| 68 | + - Only stable versions (no pre-releases) are included |
| 69 | +
|
| 70 | + ### ✅ What's Changed |
| 71 | + - Updated `cpp_linter_hooks/versions.py` with latest tool versions |
| 72 | + - No breaking changes expected |
| 73 | + - Maintains backward compatibility |
| 74 | +
|
| 75 | + ### 🔍 Review Checklist |
| 76 | + - [ ] Verify the new versions are stable releases |
| 77 | + - [ ] Check that no pre-release versions were included |
| 78 | + - [ ] Confirm the version format matches expectations |
| 79 | +
|
| 80 | + --- |
| 81 | +
|
| 82 | + *This PR was created automatically by the `update-versions.yml` workflow.* |
| 83 | + branch: update-tool-versions |
| 84 | + delete-branch: true |
| 85 | + base: main |
| 86 | + labels: dependencies |
0 commit comments