Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
087c69ac8d | ||
|
|
bb7dde1963 | ||
|
|
446380e3a9 |
@@ -2369,6 +2369,23 @@ Pre-commit hooks verify generated code is fresh — always run `make generate` a
|
|||||||
mistyped `feat` ships a minor version. `make release-dry` answers "what
|
mistyped `feat` ships a minor version. `make release-dry` answers "what
|
||||||
would this merge release" without pushing.
|
would this merge release" without pushing.
|
||||||
|
|
||||||
|
**The analyzer reads the type and ignores the scope, so a CI-only change
|
||||||
|
is `ci:` and never `fix(ci):`.** The scope is decoration; `fix` is a
|
||||||
|
patch whatever is in the brackets. Two commits touching nothing but
|
||||||
|
`.gitea/workflows/unclaim.yml` were written `fix(ci):` and cut `v0.2.1`
|
||||||
|
and `v0.2.2` — real releases, published to Arch, Homebrew and the APK
|
||||||
|
registry, containing no user-facing change. They were left in place
|
||||||
|
rather than deleted, because a version that vanishes is worse for
|
||||||
|
whoever pulled it than one that turns out to be empty.
|
||||||
|
|
||||||
|
**The blast radius is bigger than the version number**, which is what
|
||||||
|
makes this worth a paragraph. A merge to `main` starts two workflows;
|
||||||
|
if `release.yml` then pushes a tag, that tag push starts **four more**
|
||||||
|
(`arch-package`, `homebrew-formula`, `android-apk`, `desktop-assets`) —
|
||||||
|
on a runner with capacity 1, where the APK build alone is tens of
|
||||||
|
minutes. `make release-dry` before merging is how you find out, and it
|
||||||
|
is cheaper than every one of those.
|
||||||
|
|
||||||
**`@semantic-release/github` is not in that config and must not be.**
|
**`@semantic-release/github` is not in that config and must not be.**
|
||||||
Gitea's API is `/api/v1` and is not GitHub's surface, so
|
Gitea's API is `/api/v1` and is not GitHub's surface, so
|
||||||
`@semantic-release/exec` calls `scripts/gitea-release.sh` instead — one
|
`@semantic-release/exec` calls `scripts/gitea-release.sh` instead — one
|
||||||
|
|||||||
+27
-3
@@ -38,8 +38,10 @@
|
|||||||
# Where a body is taken and no --body-file is given, it is read from stdin.
|
# Where a body is taken and no --body-file is given, it is read from stdin.
|
||||||
#
|
#
|
||||||
# Environment:
|
# Environment:
|
||||||
# GITEA_TOKEN a PAT with write:issue (plus write:repository and read:user,
|
# GITEA_TOKEN a PAT with write:issue. `claim` and `mine` additionally
|
||||||
# which the rest of this repo's tooling reaches for)
|
# need to know your username: set GITEA_USER, or give the
|
||||||
|
# token read:user and it is looked up.
|
||||||
|
# GITEA_USER your Gitea login. Optional; see above.
|
||||||
# GITEA_URL defaults to https://git.ljones.me
|
# GITEA_URL defaults to https://git.ljones.me
|
||||||
# GITEA_REPO defaults to yonlu/yellowjacket
|
# GITEA_REPO defaults to yonlu/yellowjacket
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -81,7 +83,29 @@ read_body() {
|
|||||||
if [ "$file" = "-" ]; then cat; else cat "$file"; fi
|
if [ "$file" = "-" ]; then cat; else cat "$file"; fi
|
||||||
}
|
}
|
||||||
|
|
||||||
me() { curl -sS -H "Authorization: token $GITEA_TOKEN" "$server/api/v1/user" | python3 "$py" login; }
|
# The one lookup in this script that needs a scope beyond write:issue.
|
||||||
|
# `GET /user` requires read:user, and it is reached for exactly two reasons:
|
||||||
|
# to name the assignee in `claim`, and to filter in `mine`. A token scoped to
|
||||||
|
# the work this script does — write:issue — therefore failed at `claim`, which
|
||||||
|
# is the one step the workflow requires before the first edit, so the whole
|
||||||
|
# documented process was blocked by its own tooling.
|
||||||
|
#
|
||||||
|
# GITEA_USER short-circuits it, which is what lets a least-privilege token do
|
||||||
|
# the job. The lookup stays as the fallback because it is right when the
|
||||||
|
# scope is there and needs no setup at all.
|
||||||
|
me() {
|
||||||
|
if [ -n "${GITEA_USER:-}" ]; then
|
||||||
|
printf '%s' "$GITEA_USER"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
curl -sS -H "Authorization: token $GITEA_TOKEN" "$server/api/v1/user" |
|
||||||
|
python3 "$py" login ||
|
||||||
|
{
|
||||||
|
echo "issue.sh: could not resolve your username. Set GITEA_USER, or" >&2
|
||||||
|
echo "issue.sh: re-issue GITEA_TOKEN with read:user." >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
label_id() { call GET "/labels?limit=100" | python3 "$py" label-id "$1"; }
|
label_id() { call GET "/labels?limit=100" | python3 "$py" label-id "$1"; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user