Skip to content

Ignore scripts/, CLAUDE.md, .gitignore in auto-tag filter - #373

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

Ignore scripts/, CLAUDE.md, .gitignore in auto-tag filter#373
ymodlin merged 2 commits into
devfrom
ci/auto-tag

Conversation

@ymodlin

@ymodlin ymodlin commented Feb 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds scripts/, CLAUDE.md, and .gitignore to the ignored paths in the auto-tag version bump workflow
  • These files don't represent meaningful driver changes and shouldn't trigger a version bump

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 20, 2026 12:13
ymodlin and others added 2 commits February 20, 2026 14:16
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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

This PR adds a new GitHub Actions workflow for automated daily version bumping and introduces Claude Code configuration. The workflow monitors the dev branch for meaningful changes (excluding documentation, tests, CI configs, scripts, and metadata files) and automatically increments the build number in the kernel driver version when changes are detected.

Changes:

  • Creates an auto-tag workflow that runs daily to check for meaningful driver changes and bump versions accordingly
  • Adds Claude Code permissions configuration to control allowed/denied commands in the development environment

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated 12 comments.

File Description
.github/workflows/auto-tag.yml New workflow for automated version bumping on dev branch with filtering for non-driver changes
.claude/settings.json New Claude Code permissions configuration allowing development commands while restricting dangerous operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


# Filter out ignored paths
meaningful=$(echo "$changed" | grep -v -E '^(\.claude/|\.github/|test/|docs/)' || true)
meaningful=$(echo "$changed" | grep -v -E '^(\.claude/|\.github/|test/|docs/|scripts/|CLAUDE\.md$|\.gitignore$)' || true)

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 pattern \.gitignore$ only matches the root-level .gitignore file. If a .gitignore file is added or modified in a non-ignored subdirectory (e.g., kernel/.gitignore, utilities/.gitignore), it will be considered a "meaningful change" and trigger a version bump.

While .gitignore files in already-ignored directories like test/ and scripts/ are correctly excluded (since those directory patterns match first), .gitignore files in other directories would trigger bumps. If the intent is to ignore all .gitignore files regardless of location, consider using a pattern like (^|/)\.gitignore$ or simply \.gitignore (without anchors) to match any path ending with .gitignore.

Suggested change
meaningful=$(echo "$changed" | grep -v -E '^(\.claude/|\.github/|test/|docs/|scripts/|CLAUDE\.md$|\.gitignore$)' || true)
meaningful=$(echo "$changed" | grep -v -E '^(\.claude/|\.github/|test/|docs/|scripts/|CLAUDE\.md$|.*\.gitignore$)' || true)

Copilot uses AI. Check for mistakes.
id: bump
run: |
current="${{ steps.version.outputs.current }}"
IFS='.' read -r major minor patch build <<< "$current"

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 version parsing assumes a 4-part version number (major.minor.patch.build), but there's no validation that the version string actually has 4 parts. If the MODULE_VERSION in d4xx.c has fewer than 4 parts (e.g., "1.0.2"), the read command will leave build empty, and new_build=$((build + 1)) will result in new_build=1 instead of failing. This could silently introduce incorrect version numbers.

Consider adding validation after the IFS read to ensure all four variables are populated, for example:

if [ -z "$major" ] || [ -z "$minor" ] || [ -z "$patch" ] || [ -z "$build" ]; then
  echo "::error::Version '$current' must have exactly 4 parts (major.minor.patch.build)"
  exit 1
fi
Suggested change
IFS='.' read -r major minor patch build <<< "$current"
if [ -z "$major" ] || [ -z "$minor" ] || [ -z "$patch" ] || [ -z "$build" ]; then
echo "::error::Version '$current' must have exactly 4 parts (major.minor.patch.build)"
exit 1
fi

Copilot uses AI. Check for mistakes.
run: |
current="${{ steps.version.outputs.current }}"
new_version="${{ steps.bump.outputs.new_version }}"
sed -i "s/MODULE_VERSION(\"${current}\")/MODULE_VERSION(\"${new_version}\")/" kernel/realsense/d4xx.c

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 sed command uses unescaped special regex characters in the replacement pattern. If the version number contains characters that have special meaning in sed's replacement context (like &, /, or \), the sed command could behave unexpectedly. While version numbers typically don't contain such characters, it's a good practice to escape the variables or use a different delimiter.

Consider using a delimiter that won't appear in version strings, or escape the variables properly. For example:

sed -i "s|MODULE_VERSION(\"${current}\")|MODULE_VERSION(\"${new_version}\")|" kernel/realsense/d4xx.c

Using | as the delimiter avoids conflicts with / if it ever appears in version strings.

Suggested change
escaped_new_version=${new_version//&/\\&}
sed -i "s|MODULE_VERSION(\"${current}\")|MODULE_VERSION(\"${escaped_new_version}\")|" kernel/realsense/d4xx.c

Copilot uses AI. Check for mistakes.

# Filter out ignored paths
meaningful=$(echo "$changed" | grep -v -E '^(\.claude/|\.github/|test/|docs/)' || true)
meaningful=$(echo "$changed" | grep -v -E '^(\.claude/|\.github/|test/|docs/|scripts/|CLAUDE\.md$|\.gitignore$)' || true)

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 PR description states "Adds scripts/, CLAUDE.md, and .gitignore to the ignored paths in the auto-tag version bump workflow", which implies these are being added to an existing workflow. However, this appears to be a new file (based on the diff showing all lines as additions starting from line 1).

If this is indeed a new file, the PR description should clarify that this is creating a new auto-tag workflow that includes these paths in the ignore list, rather than adding them to an existing workflow. If this is modifying an existing file, please verify that the diff is correctly showing the changes.

Copilot uses AI. Check for mistakes.
Comment on lines 118 to 125
- 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.

The workflow pushes the commit and tag in separate steps (lines 118-124). If the commit push succeeds but the tag push fails, the repository will be in an inconsistent state: the version bump commit exists on the remote, but the corresponding tag doesn't.

Consider combining the push operations into a single step, or add error handling to ensure both succeed or both fail. For example:

git push origin dev && git push origin "$new_tag" || {
  echo "::error::Failed to push. Repository may be in inconsistent state."
  exit 1
}

Alternatively, push both in a single command: git push origin dev "$new_tag"

Suggested change
- name: Push commit and tag
if: steps.changes.outputs.has_changes == 'true'
run: |
new_tag="${{ steps.bump.outputs.new_tag }}"
git push origin dev && git push origin "$new_tag" || {
echo "::error::Failed to push commit and tag. Repository may be in inconsistent state."
exit 1
}

Copilot uses AI. Check for mistakes.
Comment thread .claude/settings.json
Comment on lines 1 to 82

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 .claude/settings.json file is included in this PR, but the PR description only mentions changes to the auto-tag workflow filter. This file doesn't appear to be related to the stated purpose of the PR (adding ignored paths to the auto-tag workflow).

If this file is being added as part of setting up the Claude Code environment and is unrelated to the auto-tag changes, it should either be in a separate PR or the PR description should be updated to mention it. Including unrelated changes in a single PR makes it harder to review and understand the purpose of each change.

Copilot uses AI. Check for mistakes.
meaningful=$(echo "$changed" | grep -v -E '^(\.claude/|\.github/|test/|docs/|scripts/|CLAUDE\.md$|\.gitignore$)' || true)

if [ -z "$meaningful" ]; then
echo "Only ignored-folder changes since $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.

The comment "Only ignored-folder changes" is misleading because the ignored paths include specific files (CLAUDE.md, .gitignore) in addition to folders. Consider updating to "Only ignored-path changes" or "Only non-meaningful changes" for accuracy.

Suggested change
echo "Only ignored-folder changes since $tag:"
echo "Only ignored-path changes since $tag:"

Copilot uses AI. Check for mistakes.
new_version="${{ steps.bump.outputs.new_version }}"
new_tag="${{ steps.bump.outputs.new_tag }}"

git config user.email "builder@example.com"

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 git configuration uses "builder@example.com" as the commit author email. Using "example.com" might cause issues with some git hosting services or organizational policies that validate email domains. Consider using a noreply email address specific to your GitHub organization (e.g., "builder@users.noreply.github.com") or a valid domain email address.

Suggested change
git config user.email "builder@users.noreply.github.com"

Copilot uses AI. Check for mistakes.

permissions:
contents: write

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 workflow can run concurrently via scheduled runs and manual workflow_dispatch triggers. If two instances run simultaneously, they might:

  1. Both detect the same "latest tag"
  2. Both calculate the same "new version"
  3. Both try to commit and push, leading to conflicts

Consider adding a concurrency group to prevent multiple instances from running simultaneously:

concurrency:
  group: auto-tag-version-bump
  cancel-in-progress: false

This ensures only one instance runs at a time, with subsequent triggers queued.

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

Copilot uses AI. Check for mistakes.
Comment thread .claude/settings.json
Comment on lines 38 to 39

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 permissions allow unrestricted ssh * and scp * commands. These wildcards grant very broad access and could potentially be used to access unintended systems or transfer sensitive data. Consider restricting these to specific hosts or patterns that are necessary for the development workflow, for example:

  • Bash(ssh user@specific-host *)
  • Bash(scp * user@specific-host:*)

This follows the principle of least privilege and reduces the attack surface if the Claude Code environment were to be compromised.

Suggested change
"Bash(ssh user@specific-host *)",
"Bash(scp * user@specific-host:*)",

Copilot uses AI. Check for mistakes.
@ymodlin
ymodlin merged commit 8e95a44 into dev Feb 20, 2026
6 checks passed
@ymodlin
ymodlin deleted the ci/auto-tag branch May 27, 2026 10:38
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