Add auto-tag daily version bump workflow - #372
Conversation
Runs daily at 14:00 UTC (~17:00 Tel Aviv) and on manual dispatch. Bumps the MODULE_VERSION build number in d4xx.c and creates an annotated tag when meaningful changes exist on dev since the last tag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds automation around code quality checks and release tagging/versioning for the kernel/realsense driver, primarily targeting the dev branch workflow.
Changes:
- Add a daily/manual GitHub Actions workflow to bump
MODULE_VERSIONinkernel/realsense/d4xx.c, create an annotatedvX.Y.Z.Wtag, and push todevwhen meaningful changes exist. - Add a static-analysis workflow running
cppcheck,sparse, andsmatchagainst the RealSense kernel driver path. - Add a
.claude/settings.jsonconfiguration file for Claude tool permissions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/static-analysis.yml | Introduces CI static-analysis jobs (cppcheck + sparse/smatch) scoped to kernel/realsense/**. |
| .github/workflows/auto-tag.yml | Introduces scheduled/manual version bump + tagging automation for dev. |
| .claude/settings.json | Adds Claude Code tool-permission configuration (non-runtime repo metadata). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Push commit | ||
| if: steps.changes.outputs.has_changes == 'true' | ||
| run: git push origin dev | ||
|
|
||
| - name: Push tag | ||
| if: steps.changes.outputs.has_changes == 'true' | ||
| run: git push origin "${{ steps.bump.outputs.new_tag }}" | ||
|
|
There was a problem hiding this comment.
Commit and tag are pushed in separate steps. If the commit push succeeds but the tag push fails, dev is bumped without a corresponding tag and reruns can keep bumping again. Consider pushing commit+tag together (e.g., git push --follow-tags) and failing the job if either ref can’t be pushed.
| - name: Push commit | |
| if: steps.changes.outputs.has_changes == 'true' | |
| run: git push origin dev | |
| - name: Push tag | |
| if: steps.changes.outputs.has_changes == 'true' | |
| run: git push origin "${{ steps.bump.outputs.new_tag }}" | |
| - name: Push commit and tag | |
| if: steps.changes.outputs.has_changes == 'true' | |
| run: git push --follow-tags origin dev |
| steps: | ||
| - name: Checkout dev | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
steps: is not followed by an indented YAML sequence. In GitHub Actions, list items under steps must be indented further than the steps: key (e.g., steps: then - name: ...). As written, this workflow file is invalid YAML and will fail to load.
| IFS='.' read -r major minor patch build <<< "$current" | ||
| new_build=$((build + 1)) |
There was a problem hiding this comment.
The build-number bump assumes MODULE_VERSION always has exactly 4 dot-separated numeric components. If build is empty/non-numeric (or has leading zeros like 09), the bash arithmetic will fail or behave unexpectedly. Add validation (regex) and use base-10 arithmetic (e.g., new_build=$((10#$build + 1))) with a clear error if the version format is unsupported.
| IFS='.' read -r major minor patch build <<< "$current" | |
| new_build=$((build + 1)) | |
| if [[ ! "$current" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then | |
| echo "::error::Unsupported MODULE_VERSION format '$current'. Expected 'X.Y.Z.BUILD' with numeric components." | |
| exit 1 | |
| fi | |
| major="${BASH_REMATCH[1]}" | |
| minor="${BASH_REMATCH[2]}" | |
| patch="${BASH_REMATCH[3]}" | |
| build="${BASH_REMATCH[4]}" | |
| new_build=$((10#$build + 1)) |
| schedule: | ||
| - cron: '0 14 * * *' | ||
| workflow_dispatch: | ||
|
|
There was a problem hiding this comment.
This workflow can run on both schedule and workflow_dispatch, but there is no concurrency guard. Overlapping runs can race (both compute the same next version/tag) and cause push/tag failures or inconsistent bumps. Add workflow/job-level concurrency (e.g., grouped by workflow name + dev) to ensure only one bump runs at a time.
| concurrency: | |
| group: auto-tag-dev | |
| cancel-in-progress: false |
Summary
MODULE_VERSIONbuild number ind4xx.cand creates an annotated git tagworkflow_dispatchdevsince the last tag (ignores.claude/,.github/,test/,docs/)How it works
v*tag reachable fromdevMODULE_VERSION, increments the 4th component (build number)"Bump version to X.Y.Z.W", creates annotated tagvX.Y.Z.W, pushes bothPrerequisites
github-actions[bot]to thedevbranch protection bypass list so the workflow can push directlyTest plan
dev, then trigger manually viaworkflow_dispatchon GitHub Actions UIdevwith bumpedMODULE_VERSIONand matching tag🤖 Generated with Claude Code