Auto-updates
Automatic update detection and application for team mode rule sources.
Overview
AlignTrue’s auto-update system helps teams stay current with approved rule sources. When sources publish new versions, you can detect, review, and apply updates with confidence.
Key features:
- Detect available updates from allowed sources
- Preview changes before applying
- Automatic UPDATE_NOTES.md generation
- CI integration for scheduled checks
- Automatic sync after updates
Manual workflow
Check for updates
Preview available updates without making changes:
aligntrue update checkExample output:
Available Updates
=================
Source: git:https://github.com/AlignTrue/base-global
Current: abc123...
Latest: def456...
Affected rules: security/no-eval, perf/async-await
Summary:
1 source(s) updated
2 rule(s) affected
0 breaking change(s)
Run 'aligntrue update apply' to apply these updates.Apply updates
Apply detected updates and generate UPDATE_NOTES.md:
aligntrue update applyThis will:
- Detect available updates
- Generate UPDATE_NOTES.md with change summary
- Run
aligntrue sync --forceto apply changes - Update
.aligntrue.lock.jsonwith new hashes
Dry run
Preview what would be applied without making changes:
aligntrue update apply --dry-runCI integration
Scheduled update checks
GitHub Actions
Create .github/workflows/check-aligntrue-updates.yml:
name: Check AlignTrue updates
on:
schedule:
- cron: "0 0 * * 1" # Weekly on Monday
workflow_dispatch:
jobs:
check-updates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install AlignTrue CLI
run: npm install -g @aligntrue/cli
- name: Check for updates
id: check
run: |
if aligntrue update check | grep -q "No updates available"; then
echo "has_updates=false" >> $GITHUB_OUTPUT
else
echo "has_updates=true" >> $GITHUB_OUTPUT
fi
- name: Apply updates
if: steps.check.outputs.has_updates == 'true'
run: aligntrue update apply
- name: Create Pull Request
if: steps.check.outputs.has_updates == 'true'
uses: peter-evans/create-pull-request@v5
with:
commit-message: "chore: update AlignTrue sources"
title: "Update AlignTrue rule sources"
body-path: UPDATE_NOTES.md
branch: aligntrue-updates
delete-branch: trueUPDATE_NOTES.md format
Generated automatically by aligntrue update apply:
# AlignTrue update notes
Generated: 2025-10-30 12:00:00
## Summary
- 2 sources updated
- 5 rules affected
- 0 breaking changes
## Updates
### AlignTrue/base-global (org/repo)
- Previous: abc123 (2025-10-25)
- Current: def456 (2025-10-30)
- Affected rules: security/no-eval, perf/async-await
- Breaking: No
### AlignTrue/typescript-pack
- Previous: xyz789 (2025-10-28)
- Current: new123 (2025-10-30)
- Affected rules: ts/strict-mode, ts/no-any, ts/explicit-returns
- Breaking: No
## Next steps
1. Review changes in affected rules
2. Run `aligntrue check` to validate
3. Test your project with updated rules
4. Commit changes when satisfiedBest practices
Review cycle
Weekly checks: Schedule weekly update checks during low-traffic periods.
Review before merge: Always review UPDATE_NOTES.md before merging auto-update PRs. Check:
- What rules changed and why
- Impact on your codebase
- Breaking changes (if any)
- Upstream release notes
Test locally: For major updates, test locally before merging:
git checkout aligntrue-updates
aligntrue check
# Run your project's tests
git merge aligntrue-updatesAllow list hygiene
Keep your allow list current:
# Review approved sources
aligntrue team list-allowed
# Remove deprecated sources
aligntrue team remove <source>Breaking changes
When breaking changes detected:
- Review the change in UPDATE_NOTES.md
- Check if your code needs updates
- Use severity remapping if temporary exception needed
- Document rationale in
.aligntrue.team.yaml
Rollback procedure
If updates cause issues:
# Revert the update
git revert HEAD
# Or restore from backup
aligntrue backup restore <backup-id>
# Sync to previous state
aligntrue sync --forceTroubleshooting
No updates detected
Symptom: aligntrue update check shows no updates, but you expect them.
Causes:
- Source not in allow list
- Allow list has stale resolved_hash
- Not in team mode
Fix:
# Check team mode
aligntrue team status
# Re-approve source to refresh hash
aligntrue team approve <source>
# Check allow list
cat .aligntrue/allow.yamlUpdate fails to apply
Symptom: aligntrue update apply errors during sync.
Causes:
- Conflicting local changes
- Missing dependencies
- Network issues
Fix:
# Check for local changes
git status
# Try with force flag (already used by update apply)
aligntrue sync --force
# Review error details
aligntrue check --verboseCI workflow not triggering
Symptom: Scheduled workflow doesn’t run.
Causes:
- Workflow file not committed
- Schedule syntax error
- Repository permissions
Fix:
# Validate workflow syntax
cat .github/workflows/check-aligntrue-updates.yml
# Check GitHub Actions permissions
# Settings > Actions > General > Workflow permissions
# Test manually
gh workflow run check-aligntrue-updates.ymlUPDATE_NOTES.md not generated
Symptom: aligntrue update apply succeeds but no notes file.
Causes:
- Write permission issues
- Current directory not repo root
Fix:
# Check current directory
pwd
# Check write permissions
ls -la | grep UPDATE_NOTES.md
# Run from repo root
cd "$(git rev-parse --show-toplevel)"
aligntrue update applyRelated docs
- Team mode guide - Enable and configure team mode
- Drift detection - Monitor alignment drift
- Git workflows - Pull and link commands
- Commands reference - Complete command documentation
For questions or issues, see troubleshooting guide or open an issue on GitHub.