🐛 fix(ci): read DRONE_TAG via awk ENVIRON to fix empty release body
Some checks failed
continuous-integration/drone/tag Build is failing
Some checks failed
continuous-integration/drone/tag Build is failing
Drone CI substitutes ${VAR} in commands before the shell runs.
Since TAG is a local shell variable (not a Drone var), ${TAG} was
replaced with an empty string, causing the awk pattern to match
nothing and the release body to be empty.
Fix: read DRONE_TAG directly inside awk via ENVIRON["DRONE_TAG"]
and strip the v-prefix with gsub — no intermediate shell variable needed.
Also translate CHANGELOG.md to English.
This commit is contained in:
parent
3c78a5afe3
commit
fcb7c7f6a6
11
.drone.yml
11
.drone.yml
@ -76,9 +76,14 @@ steps:
|
||||
commands:
|
||||
- apk add --no-cache curl jq
|
||||
- |
|
||||
# Extract changelog entry for this tag (strip leading 'v' to match CHANGELOG format)
|
||||
TAG="${DRONE_TAG#v}"
|
||||
BODY=$(awk "/^## \[${TAG}\]/{found=1; next} found && /^## \[/{exit} found{print}" CHANGELOG.md)
|
||||
# Read DRONE_TAG via ENVIRON inside awk to avoid Drone's ${VAR} substitution
|
||||
# which would replace ${TAG} with an empty string before the shell runs.
|
||||
BODY=$(awk '
|
||||
BEGIN { tag = ENVIRON["DRONE_TAG"]; gsub(/^v/, "", tag) }
|
||||
/^## \[/ { in_section = (index($0, "[" tag "]") > 0); next }
|
||||
in_section && /^## \[/ { exit }
|
||||
in_section { print }
|
||||
' CHANGELOG.md)
|
||||
RELEASE_ID=$(curl -fsSL -X POST \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
|
||||
26
CHANGELOG.md
26
CHANGELOG.md
@ -7,29 +7,33 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
## [0.3.0] - 2026-03-01
|
||||
|
||||
### Added
|
||||
- Verificação de dependências (`fzf` e `tmux`) ao iniciar, antes de qualquer operação
|
||||
- Detecção automática do gerenciador de pacotes da distro (apt, pacman, dnf, yum, zypper, emerge, xbps, apk)
|
||||
- Oferta interativa de instalação caso as ferramentas estejam ausentes
|
||||
- Módulo `deps` com trait `BinaryChecker` injetável para testes unitários sem tocar no sistema real
|
||||
- Testes de integração em `tests/deps.rs` (11 testes com `SystemBinaryChecker` real)
|
||||
- Suite de testes em container Docker Ubuntu 24.04 (`tests/docker/`) com 15 cenários simulando novo usuário
|
||||
- Dependency check for `fzf` and `tmux` at startup, before any operation
|
||||
- Automatic Linux package manager detection (apt, pacman, dnf, yum, zypper, emerge, xbps, apk)
|
||||
- Interactive installation prompt when required tools are missing
|
||||
- `deps` module with injectable `BinaryChecker` trait for unit testing without hitting the real system
|
||||
- Integration tests in `tests/deps.rs` (11 tests using real `SystemBinaryChecker`)
|
||||
- Docker test suite in `tests/docker/` with 15 scenarios simulating a fresh Ubuntu 24.04 user
|
||||
|
||||
### Fixed
|
||||
- Release pipeline `publish` step now reads `DRONE_TAG` via awk `ENVIRON` to prevent Drone's
|
||||
`${VAR}` substitution from wiping local shell variables before the shell runs
|
||||
|
||||
## [0.2.4] - 2026-03-01
|
||||
|
||||
### Fixed
|
||||
- Cálculo do percentual de cobertura no CI (campo correto do JSON do tarpaulin)
|
||||
- Pipeline `release` restrito a tags com formato de versão (`[0-9]*`)
|
||||
- Coverage percentage calculation in CI (correct field from tarpaulin JSON output)
|
||||
- Release pipeline trigger now matches `v*` tag format instead of `[0-9]*`
|
||||
|
||||
## [0.2.2] - 2026-02-28
|
||||
|
||||
### Added
|
||||
- Coverage badge gerado por `cargo-tarpaulin` no CI e hospedado no Gitea Generic Package Registry
|
||||
- CI status, coverage, version e Rust edition badges no README
|
||||
- Coverage badge generated by `cargo-tarpaulin` in CI, hosted in Gitea Generic Package Registry
|
||||
- CI status, coverage, version, and Rust edition badges in README
|
||||
|
||||
## [0.2.1] - 2026-02-28
|
||||
|
||||
### Added
|
||||
- Drone CI pipeline (`ci`) that runs `cargo fmt --check`, `cargo clippy`, and `cargo test` on every push and pull request
|
||||
- Drone CI pipeline (`ci`) running `cargo fmt --check`, `cargo clippy`, and `cargo test` on every push and pull request
|
||||
|
||||
## [0.2.0] - 2026-02-28
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user