Skip to content

Add auto-tag daily version bump workflow - #372

Merged
ymodlin merged 2 commits into
devfrom
ci/auto-tag
Feb 20, 2026
Merged

Add auto-tag daily version bump workflow#372
ymodlin merged 2 commits into
devfrom
ci/auto-tag

Conversation

@ymodlin

@ymodlin ymodlin commented Feb 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a GitHub Actions workflow that automatically bumps the MODULE_VERSION build number in d4xx.c and creates an annotated git tag
  • Runs daily at 14:00 UTC (~17:00 Tel Aviv time) and supports manual workflow_dispatch
  • Only bumps when meaningful changes exist on dev since the last tag (ignores .claude/, .github/, test/, docs/)

How it works

  1. Finds the latest v* tag reachable from dev
  2. Checks for file changes outside ignored directories
  3. Parses MODULE_VERSION, increments the 4th component (build number)
  4. Commits as "Bump version to X.Y.Z.W", creates annotated tag vX.Y.Z.W, pushes both

Prerequisites

  • Add github-actions[bot] to the dev branch protection bypass list so the workflow can push directly

Test plan

  • Merge to dev, then trigger manually via workflow_dispatch on GitHub Actions UI
  • Verify new commit on dev with bumped MODULE_VERSION and matching tag
  • Verify skip behavior when no meaningful changes exist since last tag

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 20, 2026 11:30
ymodlin and others added 2 commits February 20, 2026 13:32
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_VERSION in kernel/realsense/d4xx.c, create an annotated vX.Y.Z.W tag, and push to dev when meaningful changes exist.
  • Add a static-analysis workflow running cppcheck, sparse, and smatch against the RealSense kernel driver path.
  • Add a .claude/settings.json configuration 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.

Comment on lines +117 to +124
- 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 }}"

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- 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

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +17
steps:
- name: Checkout dev
uses: actions/checkout@v4

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +83 to +84
IFS='.' read -r major minor patch build <<< "$current"
new_build=$((build + 1))

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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))

Copilot uses AI. Check for mistakes.
schedule:
- cron: '0 14 * * *'
workflow_dispatch:

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
concurrency:
group: auto-tag-dev
cancel-in-progress: false

Copilot uses AI. Check for mistakes.
@ymodlin
ymodlin merged commit 287e105 into dev Feb 20, 2026
6 checks passed
@ymodlin
ymodlin deleted the ci/auto-tag branch February 20, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants