Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Protect released v* tags with a tag ruleset

Abierto
#53 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
75/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
git, github
Área
release

Línea de trabajo

Comienza con la API de rulesets del repositorio y el comando gh api proporcionado; después, inspecciona el ruleset existente Protect main para compararlo. Crea un ruleset de tags activo que coincida con refs/tags/v* y verifica que su patrón de ref no tenga comillas sobrantes. Se considera terminado cuando se rechacen la eliminación y las actualizaciones forzadas de los tags v*, mientras que los tags que no sean v* permanezcan sin cambios.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem

v* tags are now the only path to a production deploy (#52), but nothing makes
a released tag immutable. There is no tag ruleset on this repo — the only
ruleset is Protect main, which targets branches.

So after v2.0.0 has built, passed every gate and deployed, the tag can be
deleted and re-pushed at a different commit:

git tag -d v2.0.0 && git push origin :refs/tags/v2.0.0
git tag v2.0.0 <any-commit> && git push origin v2.0.0

That re-runs the whole pipeline and deploys the new commit under a version
number that already means something else. The release history stops being a
record of what was shipped, and the github-pages environment's v* tag policy
happily allows it because the ref name is unchanged.

Proposed fix

Add a repository ruleset targeting tags:

  • Target: tag, include pattern v*
  • Rules: deletion (block tag deletion), non_fast_forward (block force
    updates)
  • Enforcement: active, no bypass actors
gh api repos/laywill/laywill.github.io/rulesets \
  -X POST \
  -f name='Protect release tags' \
  -f target='tag' \
  -f enforcement='active' \
  -f 'conditions[ref_name][include][]=refs/tags/v*' \
  -f 'conditions[ref_name][exclude][]' \
  -f 'rules[][type]=deletion' \
  -f 'rules[][type]=non_fast_forward'

Worth confirming the resulting conditions.ref_name.include reads back as
refs/tags/v* with no stray quote characters — a literal-quote pattern silently
matches nothing, which is how the github-pages tag policy and the main entry
in Protect main were both broken on first attempt.

Trade-off

Mistyped or premature tags become unfixable in place; the recovery is to burn the
version and tag the next one. That is the normal cost of immutable releases and
is cheap here — pre-release tags (v2.0.0-rc.N) run the full pipeline and skip
deploy, so a candidate can be exercised before the real tag is cut.

Acceptance criteria

  • Tag ruleset exists, active, matching refs/tags/v*
  • git push origin :refs/tags/<test-tag> is rejected for a v* tag
  • Force-updating an existing v* tag is rejected
  • Non-v* tags are unaffected

Related

  • #25, #52 — the tag-gated release pipeline this protects
Lenguaje dominante
HTML
Estrellas
0
Forks
0
Merge medio
8 h 17 min
PR fusionados (30 d)
58

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de laywill/laywill.github.io

Todos los issues de laywill/laywill.github.io

Issues similares

Más issues de Release

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.