diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 7f1bdf7..22c9c36 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -110,21 +110,14 @@ jobs: tag: name: Release currency - runs-on: ubuntu-latest - timeout-minutes: 20 - - # Not on push: the tag is expected to lag between pushing a commit and - # moving it, and a job that fails for the minute in between is one people - # learn to ignore. Weekly is soon enough to catch a tag left behind. + # The shared hygiene workflow runs laranail/package-tools' canonical check, + # so this package no longer carries its own copy. Release tags are + # immutable: a tag behind main is a warning that a release is due, never a + # red run. The shared job already skips pull requests, and the other + # hygiene checks are off here because the jobs above run them. if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - - steps: - - uses: actions/checkout@v7 - - # Pre-1.0 the tag moves and consumers resolve ^0.1 through it, so a tag - # left behind ships them code without the fixes rather than merely - # without the features. v0.1.0 here sat behind a security fix. - - name: Verify the moving tag is on main - run: bash scripts/verify-tag-currency.sh ${{ github.repository }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: laranail/.github/.github/workflows/hygiene.yml@main + with: + run-action-pins: false + run-tag-currency: true + run-dist-integrity: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 42f7f02..c2f3255 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- The weekly release-currency check now runs through `laranail/.github`'s shared hygiene + workflow, which uses `laranail/package-tools`' canonical script. Release tags are immutable, so a + tag behind `main` is a warning that a release is due rather than a red run. + +### Deprecated + +- `scripts/verify-tag-currency.sh`. It prints a notice and delegates to the canonical script when + an installed `laranail/package-tools` already follows the immutable-tag model, and otherwise keeps + working, now advising the next patch instead of a moved tag. Earliest removal: the next minor + release. + ### Added - The views also answer to the canonical `laranail/confetti` namespace diff --git a/scripts/verify-tag-currency.sh b/scripts/verify-tag-currency.sh index 72fa4b8..a0c6ada 100755 --- a/scripts/verify-tag-currency.sh +++ b/scripts/verify-tag-currency.sh @@ -45,6 +45,19 @@ # Only meaningful pre-1.0. From 1.0 the tag is immutable by design and this # exits without an opinion. +# DEPRECATED since 2026-11-02, earliest removal in this package's next minor release. +# The canonical check is laranail/package-tools' scripts/verify-tag-currency.sh, which CI runs +# through laranail/.github's shared hygiene workflow. It follows the immutable-tag model: a tag +# behind main is a release that is due (a warning), never a tag to move. This copy prints a notice +# and delegates to that script when an installed copy (vendor/) already follows that model and `gh` +# is available; otherwise it keeps working as before, so a caller that was not found does not break. +echo "::notice::scripts/verify-tag-currency.sh is deprecated; use laranail/package-tools' scripts/verify-tag-currency.sh (CI runs it through laranail/.github's hygiene workflow)." >&2 +canonical="$(cd "$(dirname "$0")/.." && pwd)/vendor/laranail/package-tools/scripts/verify-tag-currency.sh" +if [ -f "${canonical}" ] && grep -q 'title=Release due' "${canonical}" && command -v gh >/dev/null 2>&1; then + # Same arguments as the canonical script: [branch]. + exec bash "${canonical}" "$@" +fi + set -euo pipefail REPO="${1:-}" @@ -205,7 +218,7 @@ else elif released; then fail "${current} is behind ${BRANCH}. It is a published release, so do not move it: cut ${current%.*}.$(( ${current##*.} + 1 ))." else - fail "${current} is behind ${BRANCH}. Move it (git tag -f ${current} ${BRANCH} && git push --force origin ${current}) or cut a new one." + fail "${current} is behind ${BRANCH}. Tags are immutable, so do not move it: cut ${current%.*}.$(( ${current##*.} + 1 ))." fi fi