Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ jobs:
PLUGIN: ${{ inputs.habit_hooks_plugin }}
run: pip install --disable-pip-version-check habit-hooks "$PLUGIN"
- name: Regenerate (prune to shrink; snooze only to create)
id: regen
run: |
export PATH="$PWD/node_modules/.bin:$PATH"
# --no-snooze feeds RAW findings: prune needs them to see which baselined
# files are now clean; snooze needs them to baseline all current smells.
if [ -f .habit-hooks/snooze.json ]; then
habit-sensors --all --no-snooze | habit-snooze --prune
echo "pruned=true" >> "$GITHUB_OUTPUT" # shrink-only → safe to auto-merge
else
habit-sensors --all --no-snooze | habit-snooze --snooze
echo "pruned=false" >> "$GITHUB_OUTPUT" # first-time seed → human-reviewed
fi
- name: Open a PR with the refreshed baseline
working-directory: .
Expand Down Expand Up @@ -109,3 +112,10 @@ jobs:
--title "chore: refresh habit-hooks snooze baseline" \
--body "Regenerated by the bootstrap workflow (\`--prune\` where a baseline existed, so it can only **shrink** — a new entry would mean a smell slipped past the gate). Touches only snooze.json, no source, so ruleset-guard passes with the label." \
--label ruleset-change
# A prune only ever SHRINKS the baseline (ruleset-guard verifies), so arm
# auto-merge — it lands once the required checks pass, no rubber-stamp needed.
# A first-time snooze SEEDS the baseline; leave that for human review. Requires
# the consumer repo to have "Allow auto-merge" on + branch-protection checks.
if [ "${{ steps.regen.outputs.pruned }}" = "true" ]; then
gh pr merge "$branch" --auto --merge && echo "auto-merge armed for $branch"
fi
Loading